From 8181e9c5fc81e20f0f003f4b58659f67175ed3be Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 27 May 2021 05:37:58 +0200 Subject: [PATCH] Fix missing imports --- clients/views.py | 2 +- localauth/mixins.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/views.py b/clients/views.py index ac78068..303b87d 100644 --- a/clients/views.py +++ b/clients/views.py @@ -19,7 +19,7 @@ class ClientRegistrationView(LoginRequiredMixin, RedirectToNextMixin, CreateView def dispatch(self, request, *args, **kwargs): try: ClientProfile.objects.get(user=request.user) - return HttpResponseRedirect(reverse_lazy("clients:profile")) + return redirect(reverse_lazy("clients:profile")) except (ClientProfile.DoesNotExist, TypeError): return super().dispatch(request, *args, **kwargs) diff --git a/localauth/mixins.py b/localauth/mixins.py index 0301453..eb33245 100644 --- a/localauth/mixins.py +++ b/localauth/mixins.py @@ -7,6 +7,7 @@ from django.contrib.auth.views import redirect_to_login, SuccessURLAllowedHostsM from django.conf import settings from django.contrib.auth.mixins import UserPassesTestMixin from django.urls import reverse_lazy +from django.utils.http import url_has_allowed_host_and_scheme class SuperUserRequiredMixin(UserPassesTestMixin): def test_func(self):