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):