Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Do not use usernames in email templates when usernames are disabled. #152

Merged
merged 1 commit into from

2 participants

@tvaughan

The inverse "if" logic is a little funky. But I chose to match the settings values 1-for-1.

@wunki wunki merged commit 7ac9a1e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 26, 2012
  1. Do not use usernames in email templates when usernames are disabled i…

    Tom Vaughan authored
    …n userena.
This page is out of date. Refresh to see the latest.
View
2  userena/models.py
@@ -118,6 +118,7 @@ def send_confirmation_email(self):
"""
context= {'user': self.user,
+ 'without_usernames': userena_settings.USERENA_WITHOUT_USERNAMES,
'new_email': self.email_unconfirmed,
'protocol': get_protocol(),
'confirmation_key': self.email_confirmation_key,
@@ -179,6 +180,7 @@ def send_activation_email(self):
"""
context= {'user': self.user,
+ 'without_usernames': userena_settings.USERENA_WITHOUT_USERNAMES,
'protocol': get_protocol(),
'activation_days': userena_settings.USERENA_ACTIVATION_DAYS,
'activation_key': self.activation_key,
View
4 userena/templates/userena/emails/activation_email_message.txt
@@ -1,6 +1,6 @@
{% load i18n %}{% autoescape off %}
-{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
-
+{% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
+{% endif %}
{% blocktrans with site.name as site %}Thank you for signing up at {{ site }}.{% endblocktrans %}
{% trans "To activate your account you should click on the link below:" %}
View
4 userena/templates/userena/emails/confirmation_email_message_new.txt
@@ -1,6 +1,6 @@
{% load i18n %}{% autoescape off %}
-{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
-
+{% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
+{% endif %}
{% blocktrans with site.name as site %}You requested a change of your email address at {{ site }}.{% endblocktrans %}
View
4 userena/templates/userena/emails/confirmation_email_message_old.txt
@@ -1,6 +1,6 @@
{% load i18n %}{% autoescape off %}
-{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
-
+{% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
+{% endif %}
{% blocktrans with site.name as site %}There was a request to change your email address at {{ site }}.{% endblocktrans %}
{% blocktrans %}An email has been send to {{ new_email }} which contains a verification link. Click on the link in this email to activate it.{% endblocktrans %}
View
4 userena/templates/userena/emails/password_reset_message.txt
@@ -7,10 +7,10 @@ for your user account at {{ site_name }}{% endblocktrans %}.
{{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid token=token %}
{% endblock %}
-{% blocktrans with user.username as username %}
+{% if not without_usernames %}{% blocktrans with user.username as username %}
Your username, in case you've forgotten: {{ username }}
{% endblocktrans %}
-
+{% endif %}
{% trans "Thanks for using our site!" %}
{% trans "Sincerely" %},
Something went wrong with that request. Please try again.