Fix missing imports

This commit is contained in:
Kumi 2021-05-27 05:37:58 +02:00
parent f235a7f12e
commit 8181e9c5fc
2 changed files with 2 additions and 1 deletions

View file

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

View file

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