fix bug about session without logout
This commit is contained in:
parent
732cb53fb3
commit
01eb3b3468
|
@ -28,6 +28,12 @@ class LoginView(auth_views.LoginView):
|
|||
'next',
|
||||
reverse_lazy('idhub:user_dashboard')
|
||||
)
|
||||
if not self.request.user.is_anonymous:
|
||||
if self.request.user.is_admin:
|
||||
return redirect(reverse_lazy('idhub:admin_dashboard'))
|
||||
else:
|
||||
return redirect(reverse_lazy('idhub:user_dashboard'))
|
||||
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
def form_valid(self, form):
|
||||
|
|
Loading…
Reference in a new issue