Skip to content

Commit

Permalink
improves password reset email templates, fixes #326
Browse files Browse the repository at this point in the history
  • Loading branch information
helrond committed Jul 16, 2019
1 parent 0e00587 commit fcbaf8f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{% autoescape off %}
A new account was created for you in Aurora.
A new account with the username "{{ user.get_username }}" was created for you in Aurora.

In order to log in to your {{ user.get_username }} Aurora account,
you'll need to set your password by clicking on the link below:
Please set your password by clicking on the link below, or copying and pasting the URL into your browser:

{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}

If clicking the link above doesn't work, please copy and paste the URL in a new browser
window instead.
This link will expire in 24 hours.

If this link has already expired, simply go to {{ protocol }}://{{ domain }}{% url 'password_reset' %}, and enter
your email address to receive a new link.
{% endautoescape %}
13 changes: 8 additions & 5 deletions aurora/bag_transfer/templates/users/password_reset_email.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{% autoescape off %}
Somebody (probably you) asked to reset your password for Aurora.
Somebody (probably you) asked to reset the password for the Aurora account with
the username {{ user.get_username }}.

To initiate the password reset process for your {{ user.get_username }} Aurora account,
click the link below:
To initiate the password reset process click the link below, or copy and paste
the URL into a browser:

{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}

If clicking the link above doesn't work, please copy and paste the URL in a new browser
window instead.
This link will expire in 24 hours.

If this link has already expired, simply go to {{ protocol }}://{{ domain }}{% url 'password_reset' %}, and enter
your email address to receive a new link.

If this email was sent in error, please ignore this request.
{% endautoescape %}
3 changes: 1 addition & 2 deletions aurora/bag_transfer/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,14 @@ def get_success_url(self):
def form_valid(self, form):
result = super(UserPasswordChangeView, self).form_valid(form)
set_server_password(form.user.username, form.cleaned_data['new_password1'])
return result
return result


class UserPasswordResetView(AnonymousRequiredMixin, PasswordResetView):
template_name = 'users/password_reset_form.html'
form_class = UserPasswordResetForm



class UserPasswordResetDoneView(AnonymousRequiredMixin, PasswordResetDoneView):
template_name = 'users/password_reset_done.html'

Expand Down

0 comments on commit fcbaf8f

Please sign in to comment.