Skip to content

Commit

Permalink
Merge pull request #1135 from LibraryOfCongress/activation-bugfixes
Browse files Browse the repository at this point in the history
Minor tweaks related to account activation processes
  • Loading branch information
rstorey committed Oct 30, 2019
2 parents ed956db + 8d77983 commit d86aaaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions concordia/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ class Meta(RegistrationForm.Meta):

class UserLoginForm(AuthenticationForm):
def confirm_login_allowed(self, user):
inactive_message = (
"This account has not yet been activated. "
"An activation email has been sent to the email "
"address associated with this account. "
"Please check for this message and click the link "
"to finish your account registration."
)

# If the user provided a correct username and password combination,
# but has not yet confirmed their email,
# resend the email activation request and display a custom message.
Expand All @@ -69,16 +77,7 @@ def confirm_login_allowed(self, user):
view = RegistrationView(request=self.request)
view.send_activation_email(user)

raise forms.ValidationError(
(
"This account has not yet been activated. ",
"An activation email has been sent to the email "
"address associated with this account. ",
"Please check for this message and click the link "
"to finish your account registration.",
),
code="inactive",
)
raise forms.ValidationError(inactive_message, code="inactive")


class UserProfileForm(forms.Form):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Hi {{ user }},

Thank you for becoming a Library of Congress virtual volunteer with By the People!

To complete your activation, please verify your email address in the next {{ expiration_days |multiply:24 }} hours by clicking the link below:
To complete your activation, please verify your email address in the next {{ expiration_days }} days by clicking the link below:

https://{{ site }}{% url "django_registration_activate" activation_key %}

Expand Down

0 comments on commit d86aaaf

Please sign in to comment.