Commit a233dabd authored by Claude Paroz's avatar Claude Paroz

Fixes #92 (again) - Redirect after popup login form

parent 47cb4dd5
Pipeline #25639 failed with stage
in 2 minutes and 5 seconds
......@@ -52,6 +52,12 @@ class LoginView(AuthLoginView):
context['referer'] = self.request.META.get('HTTP_REFERER', '')
return context
def get_redirect_url(self):
url = super().get_redirect_url()
if not url:
url = self.request.META.get('HTTP_REFERER', '')
return url
def form_valid(self, form):
response = super().form_valid(form)
if Role.objects.filter(person__username=self.request.user.username).count() < 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment