From 47be413298266120efbd46b31848be4579833769 Mon Sep 17 00:00:00 2001 From: Levi Date: Sun, 28 May 2017 15:01:18 -0500 Subject: [PATCH] fixed redirect link --- utils/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/views.py b/utils/views.py index 75506959..b547506f 100644 --- a/utils/views.py +++ b/utils/views.py @@ -40,6 +40,8 @@ class LoginViewMixin(FormView): def get_success_url(self): next_url = self.request.POST.get('next', self.success_url) + if not next_url: + return self.success_url return next_url def form_valid(self, form): @@ -54,7 +56,6 @@ class LoginViewMixin(FormView): return HttpResponseRedirect(self.get_success_url()) def get(self, request, *args, **kwargs): - if self.request.user.is_authenticated(): return HttpResponseRedirect(self.get_success_url())