mirror of https://gitlab.crans.org/bde/nk20
If connected and if we have the right, directly redirect to the validation page when registering someone
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
391f3bde8f
commit
fb6e3c3de0
|
@ -85,6 +85,9 @@ class UserCreateView(CreateView):
|
|||
return super().form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
# Direct access to validation menu if we have the right to validate it
|
||||
if PermissionBackend.check_perm(self.request, 'auth.view_user', self.object):
|
||||
return reverse_lazy('registration:future_user_detail', args=(self.object.pk,))
|
||||
return reverse_lazy('registration:email_validation_sent')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue