From afa6972280fa560402e884f165193fda955f12f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Mon, 22 Jan 2018 21:59:07 +0100 Subject: [PATCH] Better handling of non-authorized users in config edition view --- gestioncof/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gestioncof/views.py b/gestioncof/views.py index 6a2582e2..2f6fd518 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -783,7 +783,7 @@ class ConfigUpdate(FormView): def dispatch(self, request, *args, **kwargs): if request.user is None or not request.user.is_superuser: - raise Http404 + return redirect_to_login(request.get_full_path()) return super().dispatch(request, *args, **kwargs) def form_valid(self, form):