From 7c7bfa11ebfa826eabe492dc57f9d1157e2eaeba Mon Sep 17 00:00:00 2001 From: Eve Martin Date: Thu, 11 Apr 2024 10:29:31 +0000 Subject: [PATCH] fix: tidy code --- portal/forms/registration.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/portal/forms/registration.py b/portal/forms/registration.py index 7e62af232..d066840cc 100644 --- a/portal/forms/registration.py +++ b/portal/forms/registration.py @@ -75,24 +75,18 @@ def save( continue if not domain_override: current_site = get_current_site(request) - site_name = current_site.name domain = current_site.domain else: - site_name = domain = domain_override - context = { - "email": user.email, - "domain": domain, - "site_name": site_name, - "uid": urlsafe_base64_encode(force_bytes(user.pk)), - "user": user, - "token": token_generator.make_token(user), - "protocol": self._compute_protocol(use_https), - } + domain = domain_override reset_password_uri = reverse_lazy( - "password_reset_check_and_confirm", kwargs={"uidb64": context["uid"], "token": context["token"]} + "password_reset_check_and_confirm", + kwargs={ + "uidb64": urlsafe_base64_encode(force_bytes(user.pk)), + "token": token_generator.make_token(user), + }, ) - protocol = context["protocol"] + protocol = self._compute_protocol(use_https) reset_password_url = f"{protocol}://{domain}{reset_password_uri}" send_dotdigital_email(