diff --git a/fabcal/routers/frontend.py b/fabcal/routers/frontend.py index bd5cf42..cae7597 100644 --- a/fabcal/routers/frontend.py +++ b/fabcal/routers/frontend.py @@ -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)