1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-04 15:32:13 +02:00

Fully test registration app

This commit is contained in:
Yohann D'ANELLO
2020-09-24 14:15:42 +02:00
parent cedb693c5b
commit 1979d33314
6 changed files with 143 additions and 9 deletions

View File

@ -45,7 +45,7 @@ class SignupView(CreateView):
return ret
def get_success_url(self):
return reverse_lazy("index")
return reverse_lazy("registration:email_validation_sent")
class UserValidateView(TemplateView):
@ -70,7 +70,7 @@ class UserValidateView(TemplateView):
if user is not None and email_validation_token.check_token(user, token):
self.validlink = True
user.registration.email_confirmed = True
user.save()
user.registration.save()
return self.render_to_response(self.get_context_data(), status=200 if self.validlink else 400)
def get_user(self, uidb64):
@ -116,8 +116,5 @@ class UserResendValidationEmailView(LoginRequiredMixin, DetailView):
def get(self, request, *args, **kwargs):
user = self.get_object()
user.profile.send_email_validation_link()
# TODO Change URL
return redirect('index')
user.registration.send_email_validation_link()
return redirect('registration:email_validation_sent')