login admin to admin_dashboard
This commit is contained in:
parent
4a7a43fbe5
commit
b3cd5e656d
|
@ -11,6 +11,10 @@ class LoginView(auth_views.LoginView):
|
|||
}
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if request.user.is_admin:
|
||||
self.extra_context['success_url'] = reverse_lazy(
|
||||
'idhub:admin_dashboard'
|
||||
)
|
||||
if request.GET.get('next'):
|
||||
self.extra_context['success_url'] = request.GET.get('next')
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue