From 4dfe3bef7bb741097297596f4d6d56f30d6278eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 7 Jul 2022 21:16:03 +0200 Subject: [PATCH] =?UTF-8?q?Doba=20pro=20neodhla=C5=A1ov=C3=A1n=C3=AD=20p?= =?UTF-8?q?=C5=99esunuta=20do=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/settings_common.py | 1 + various/autentizace/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index fe2fe3fd..baebe3b4 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -52,6 +52,7 @@ LOGIN_REDIRECT_URL = 'profil' # (pozor nefunguje na firefox se znovuotevíráním oken po startu firefoxu) # default je False a SESSION_COOKIE_AGE = 3600*24*14 = 2 týdny SESSION_EXPIRE_AT_BROWSER_CLOSE = True +DOBA_ODHLASENI_PRI_ZASKRTNUTI_NEODHLASOVAT = 365 * 24 * 3600 # rok # Modules configuration diff --git a/various/autentizace/views.py b/various/autentizace/views.py index dd5b3ae6..73b51c54 100644 --- a/various/autentizace/views.py +++ b/various/autentizace/views.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.http import HttpResponseRedirect from django.urls import reverse_lazy from django.contrib.auth import views as auth_views @@ -16,7 +17,7 @@ class LoginView(auth_views.LoginView): """ Okopírováno z django/contrib/auth/views.py s přidáním nekonečného přihlášení """ auth_login(self.request, form.get_user()) if form.cleaned_data["disable_logout"]: - form.request.session.set_expiry(365 * 24 * 3600) # rok + form.request.session.set_expiry(settings.DOBA_ODHLASENI_PRI_ZASKRTNUTI_NEODHLASOVAT) return HttpResponseRedirect(self.get_success_url())