Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url(r'^user/profile/', UpdateUserView.as_view(), name='profile'),
- url(r'^user/admin/$', UpdateAdminView.as_view(), name='admin'),
- class LoginUserView(auth_views.LoginView):
- template_name = "Login/login.html"
- #TODO
- def dispatch(self, request, *args, **kwargs):
- if self.request.user.is_superuser:
- self.redirect_field_name = reverse_lazy("profil")
- else:
- self.redirect_field_name = reverse_lazy("admin")
- return super(LoginUserView, self).dispatch(request, *args, **kwargs)
Add Comment
Please, Sign In to add comment