Skip to content

Commit

Permalink
fix: tidy code
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed Apr 11, 2024
1 parent 3dc98b3 commit 7c7bfa1
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions portal/forms/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7c7bfa1

Please sign in to comment.