Fix missing imports
This commit is contained in:
parent
f235a7f12e
commit
8181e9c5fc
2 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue