Fix rendering when max_days is not specified
This commit is contained in:
parent
bb2f840cec
commit
276110b2a2
@ -40,9 +40,19 @@ async def generate_response(request: Request, template_name: str, **additional_c
|
||||
|
||||
@router.get("/sidebar/embed.html", response_class=HTMLResponse)
|
||||
async def embed_sidebar(request: Request, max_days: int = None):
|
||||
return await generate_response(request, "sidebar/embed.html", max_days=int(max_days))
|
||||
try:
|
||||
max_days = int(max_days)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
return await generate_response(request, "sidebar/embed.html", max_days=max_days)
|
||||
|
||||
|
||||
@router.get("/sidebar/demo.html", response_class=HTMLResponse)
|
||||
async def sidebar_demo(request: Request, max_days: int = None):
|
||||
return await generate_response(request, "sidebar/demo.html", max_days=int(max_days))
|
||||
try:
|
||||
max_days = int(max_days)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
return await generate_response(request, "sidebar/demo.html", max_days=max_days)
|
||||
|
Loading…
Reference in New Issue
Block a user