diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index ae39d662..8517f424 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/templates/email-confirmation-sent.html b/osinaweb/osinacore/templates/email_confirmation_sent.html similarity index 100% rename from osinaweb/osinacore/templates/email-confirmation-sent.html rename to osinaweb/osinacore/templates/email_confirmation_sent.html diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 094e0667..185d1791 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -66,7 +66,7 @@ def confirmation_sent(request, *args, **kwargs): context = { } - return render(request, 'email-confirmation-sent.html', context) + return render(request, 'email_confirmation_sent.html', context) def signup(request): @@ -102,10 +102,10 @@ def signup(request): message = render_to_string('email_templates/account_activation_email.html', { 'user': user, 'domain': current_site.domain, - 'uid': urlsafe_base64_encode(force_bytes(user.pk)), + 'uid': urlsafe_base64_encode(force_bytes(user.pk)), #Encode the user id 'token': token, }) - send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email]) + send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email], html_message=message) return redirect('activation_sent') @@ -126,12 +126,12 @@ def signup(request): def activate(request, uidb64, token): try: - uid = str(urlsafe_base64_decode(uidb64), 'utf-8') - user = User.objects.get(pk=uid) + uid = str(urlsafe_base64_decode(uidb64), 'utf-8') #Decoding the user id which was encoded in uid + user = User.objects.get(pk=uid) #Get the user based on uid which is now the id since it was decoded in the previous line of code except (TypeError, ValueError, OverflowError, User.DoesNotExist): user = None - if user is not None and default_token_generator.check_token(user, token): + if user is not None and default_token_generator.check_token(user, token): #Check token for further security profile = CustomerProfile.objects.get(user=user) profile.status = 'Active' profile.save()