From 415c37bdb4ee2da0fe2ed9b3f0b59c0a65b321a4 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 23 May 2024 16:35:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=E2=80=94=20Prevent=20the=20refresh?= =?UTF-8?q?=20delay=20to=20be=20under=205=20seconds=20(fix=20#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- argos/server/routes/views.py | 4 +++- argos/server/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/argos/server/routes/views.py b/argos/server/routes/views.py index 4029c0e..f2ef269 100644 --- a/argos/server/routes/views.py +++ b/argos/server/routes/views.py @@ -168,5 +168,7 @@ async def set_refresh_cookies_view( status_code=status.HTTP_303_SEE_OTHER, ) response.set_cookie(key="auto_refresh_enabled", value=auto_refresh_enabled) - response.set_cookie(key="auto_refresh_seconds", value=int(auto_refresh_seconds)) + response.set_cookie( + key="auto_refresh_seconds", value=max(5, int(auto_refresh_seconds)) + ) return response diff --git a/argos/server/templates/index.html b/argos/server/templates/index.html index 35b2fe0..1794899 100644 --- a/argos/server/templates/index.html +++ b/argos/server/templates/index.html @@ -26,7 +26,7 @@ name="auto_refresh_seconds" type="number" form="refresh-form" - min="1" + min="5" value="{{ auto_refresh_seconds }}"> seconds