Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17899 -- Rewrote [Ee]-mail to [Ee]mail

  • Loading branch information...
commit 2c8267bf3db608b99c04ae903c424b60cafaaf93 1 parent 70a0de3
@Fandekasp Fandekasp authored claudep committed
Showing with 51 additions and 51 deletions.
  1. +1 −1  django/conf/global_settings.py
  2. +1 −1  django/contrib/admin/templates/admin/500.html
  3. +1 −1  django/contrib/admin/templates/registration/password_reset_done.html
  4. +1 −1  django/contrib/admin/templates/registration/password_reset_email.html
  5. +2 −2 django/contrib/admin/templates/registration/password_reset_form.html
  6. +3 −3 django/contrib/auth/forms.py
  7. +1 −1  django/contrib/auth/tests/forms.py
  8. +1 −1  django/contrib/auth/tests/templates/registration/password_reset_done.html
  9. +1 −1  django/core/validators.py
  10. +1 −1  django/db/models/fields/__init__.py
  11. +1 −1  django/forms/fields.py
  12. +1 −1  docs/index.txt
  13. +1 −1  docs/internals/deprecation.txt
  14. +2 −2 docs/ref/contrib/syndication.txt
  15. +5 −5 docs/ref/forms/api.txt
  16. +1 −1  docs/ref/forms/fields.txt
  17. +2 −2 docs/ref/forms/validation.txt
  18. +1 −1  docs/topics/testing.txt
  19. +2 −2 tests/modeltests/test_client/models.py
  20. +4 −4 tests/regressiontests/admin_views/tests.py
  21. +1 −1  tests/regressiontests/forms/tests/extra.py
  22. +14 −14 tests/regressiontests/forms/tests/fields.py
  23. +2 −2 tests/regressiontests/test_client_regress/tests.py
  24. +1 −1  tests/regressiontests/test_utils/tests.py
View
2  django/conf/global_settings.py
@@ -144,7 +144,7 @@
# Encoding of files read from disk (template and initial SQL files).
FILE_CHARSET = 'utf-8'
-# E-mail address that error messages come from.
+# Email address that error messages come from.
SERVER_EMAIL = 'root@localhost'
# Whether to send broken-link emails.
View
2  django/contrib/admin/templates/admin/500.html
@@ -12,6 +12,6 @@
{% block content %}
<h1>{% trans 'Server Error <em>(500)</em>' %}</h1>
-<p>{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}</p>
+<p>{% trans "There's been an error. It's been reported to the site administrators via email and should be fixed shortly. Thanks for your patience." %}</p>
{% endblock %}
View
2  django/contrib/admin/templates/registration/password_reset_done.html
@@ -14,6 +14,6 @@
<h1>{% trans 'Password reset successful' %}</h1>
-<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
+<p>{% trans "We've emailed you instructions for setting your password to the email address you submitted. You should be receiving it shortly." %}</p>
{% endblock %}
View
2  django/contrib/admin/templates/registration/password_reset_email.html
@@ -1,5 +1,5 @@
{% load i18n %}{% autoescape off %}
-{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
+{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
View
4 django/contrib/admin/templates/registration/password_reset_form.html
@@ -14,11 +14,11 @@
<h1>{% trans "Password reset" %}</h1>
-<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
+<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
<form action="" method="post">{% csrf_token %}
{{ form.email.errors }}
-<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
+<p><label for="id_email">{% trans 'Email address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
</form>
{% endblock %}
View
6 django/contrib/auth/forms.py
@@ -193,12 +193,12 @@ def get_user(self):
class PasswordResetForm(forms.Form):
error_messages = {
- 'unknown': _("That e-mail address doesn't have an associated "
+ 'unknown': _("That email address doesn't have an associated "
"user account. Are you sure you've registered?"),
- 'unusable': _("The user account associated with this e-mail "
+ 'unusable': _("The user account associated with this email "
"address cannot reset the password."),
}
- email = forms.EmailField(label=_("E-mail"), max_length=75)
+ email = forms.EmailField(label=_("Email"), max_length=75)
def clean_email(self):
"""
View
2  django/contrib/auth/tests/forms.py
@@ -344,4 +344,4 @@ def test_unusable_password(self):
form = PasswordResetForm(data)
self.assertFalse(form.is_valid())
self.assertEqual(form["email"].errors,
- [_("The user account associated with this e-mail address cannot reset the password.")])
+ [_("The user account associated with this email address cannot reset the password.")])
View
2  django/contrib/auth/tests/templates/registration/password_reset_done.html
@@ -1 +1 @@
-E-mail sent
+Email sent
View
2  django/core/validators.py
@@ -101,7 +101,7 @@ def __call__(self, value):
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"'
r')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$)' # domain
r'|\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$', re.IGNORECASE) # literal form, ipv4 address (SMTP 4.1.3)
-validate_email = EmailValidator(email_re, _('Enter a valid e-mail address.'), 'invalid')
+validate_email = EmailValidator(email_re, _('Enter a valid email address.'), 'invalid')
slug_re = re.compile(r'^[-a-zA-Z0-9_]+$')
validate_slug = RegexValidator(slug_re, _("Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."), 'invalid')
View
2  django/db/models/fields/__init__.py
@@ -905,7 +905,7 @@ def formfield(self, **kwargs):
class EmailField(CharField):
default_validators = [validators.validate_email]
- description = _("E-mail address")
+ description = _("Email address")
def __init__(self, *args, **kwargs):
# max_length should be overridden to 254 characters to be fully
View
2  django/forms/fields.py
@@ -461,7 +461,7 @@ def _set_regex(self, regex):
class EmailField(CharField):
default_error_messages = {
- 'invalid': _('Enter a valid e-mail address.'),
+ 'invalid': _('Enter a valid email address.'),
}
default_validators = [validators.validate_email]
View
2  docs/index.txt
@@ -241,7 +241,7 @@ applications:
* :doc:`Authentication <topics/auth>`
* :doc:`Caching <topics/cache>`
* :doc:`Logging <topics/logging>`
-* :doc:`Sending e-mails <topics/email>`
+* :doc:`Sending emails <topics/email>`
* :doc:`Syndication feeds (RSS/Atom) <ref/contrib/syndication>`
* :doc:`Comments <ref/contrib/comments/index>`, :doc:`comment moderation <ref/contrib/comments/moderation>` and :doc:`custom comments <ref/contrib/comments/custom>`
* :doc:`Pagination <topics/pagination>`
View
2  docs/internals/deprecation.txt
@@ -23,7 +23,7 @@ these changes.
* The :mod:`django.contrib.gis.db.backend` module will be removed in favor
of the specific backends.
-* ``SMTPConnection`` will be removed in favor of a generic E-mail backend API.
+* ``SMTPConnection`` will be removed in favor of a generic Email backend API.
* The many to many SQL generation functions on the database backends
will be removed.
View
4 docs/ref/contrib/syndication.txt
@@ -455,7 +455,7 @@ This example illustrates all possible attributes and methods for a
author_name = 'Sally Smith' # Hard-coded author name.
- # AUTHOR E-MAIL --One of the following three is optional. The framework
+ # AUTHOR EMAIL --One of the following three is optional. The framework
# looks for them in this order.
def author_email(self, obj):
@@ -635,7 +635,7 @@ This example illustrates all possible attributes and methods for a
item_author_name = 'Sally Smith' # Hard-coded author name.
- # ITEM AUTHOR E-MAIL --One of the following three is optional. The
+ # ITEM AUTHOR EMAIL --One of the following three is optional. The
# framework looks for them in this order.
#
# If you specify this, you must specify item_author_name.
View
10 docs/ref/forms/api.txt
@@ -105,7 +105,7 @@ Access the :attr:`~Form.errors` attribute to get a dictionary of error
messages::
>>> f.errors
- {'sender': [u'Enter a valid e-mail address.'], 'subject': [u'This field is required.']}
+ {'sender': [u'Enter a valid email address.'], 'subject': [u'This field is required.']}
In this dictionary, the keys are the field names, and the values are lists of
Unicode strings representing the error messages. The error messages are stored
@@ -538,18 +538,18 @@ method you're using::
>>> print(f.as_table())
<tr><th>Subject:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="subject" maxlength="100" /></td></tr>
<tr><th>Message:</th><td><input type="text" name="message" value="Hi there" /></td></tr>
- <tr><th>Sender:</th><td><ul class="errorlist"><li>Enter a valid e-mail address.</li></ul><input type="text" name="sender" value="invalid email address" /></td></tr>
+ <tr><th>Sender:</th><td><ul class="errorlist"><li>Enter a valid email address.</li></ul><input type="text" name="sender" value="invalid email address" /></td></tr>
<tr><th>Cc myself:</th><td><input checked="checked" type="checkbox" name="cc_myself" /></td></tr>
>>> print(f.as_ul())
<li><ul class="errorlist"><li>This field is required.</li></ul>Subject: <input type="text" name="subject" maxlength="100" /></li>
<li>Message: <input type="text" name="message" value="Hi there" /></li>
- <li><ul class="errorlist"><li>Enter a valid e-mail address.</li></ul>Sender: <input type="text" name="sender" value="invalid email address" /></li>
+ <li><ul class="errorlist"><li>Enter a valid email address.</li></ul>Sender: <input type="text" name="sender" value="invalid email address" /></li>
<li>Cc myself: <input checked="checked" type="checkbox" name="cc_myself" /></li>
>>> print(f.as_p())
<p><ul class="errorlist"><li>This field is required.</li></ul></p>
<p>Subject: <input type="text" name="subject" maxlength="100" /></p>
<p>Message: <input type="text" name="message" value="Hi there" /></p>
- <p><ul class="errorlist"><li>Enter a valid e-mail address.</li></ul></p>
+ <p><ul class="errorlist"><li>Enter a valid email address.</li></ul></p>
<p>Sender: <input type="text" name="sender" value="invalid email address" /></p>
<p>Cc myself: <input checked="checked" type="checkbox" name="cc_myself" /></p>
@@ -572,7 +572,7 @@ pass that in at construction time::
<div class="errorlist"><div class="error">This field is required.</div></div>
<p>Subject: <input type="text" name="subject" maxlength="100" /></p>
<p>Message: <input type="text" name="message" value="Hi there" /></p>
- <div class="errorlist"><div class="error">Enter a valid e-mail address.</div></div>
+ <div class="errorlist"><div class="error">Enter a valid email address.</div></div>
<p>Sender: <input type="text" name="sender" value="invalid email address" /></p>
<p>Cc myself: <input checked="checked" type="checkbox" name="cc_myself" /></p>
View
2  docs/ref/forms/fields.txt
@@ -28,7 +28,7 @@ exception or returns the clean value::
>>> f.clean('invalid email address')
Traceback (most recent call last):
...
- ValidationError: [u'Enter a valid e-mail address.']
+ ValidationError: [u'Enter a valid email address.']
Core field arguments
--------------------
View
4 docs/ref/forms/validation.txt
@@ -185,7 +185,7 @@ a look at Django's ``EmailField``::
class EmailField(CharField):
default_error_messages = {
- 'invalid': _('Enter a valid e-mail address.'),
+ 'invalid': _('Enter a valid email address.'),
}
default_validators = [validators.validate_email]
@@ -198,7 +198,7 @@ on field definition so::
is equivalent to::
email = forms.CharField(validators=[validators.validate_email],
- error_messages={'invalid': _('Enter a valid e-mail address.')})
+ error_messages={'invalid': _('Enter a valid email address.')})
Form field default cleaning
View
2  docs/topics/testing.txt
@@ -1622,7 +1622,7 @@ your test suite.
"a@a.com" as a valid email address, but rejects "aaa" with a reasonable
error message::
- self.assertFieldOutput(EmailField, {'a@a.com': 'a@a.com'}, {'aaa': [u'Enter a valid e-mail address.']})
+ self.assertFieldOutput(EmailField, {'a@a.com': 'a@a.com'}, {'aaa': [u'Enter a valid email address.']})
.. method:: TestCase.assertContains(response, text, count=None, status_code=200, msg_prefix='', html=False)
View
4 tests/modeltests/test_client/models.py
@@ -215,7 +215,7 @@ def test_form_error(self):
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "Invalid POST Template")
- self.assertFormError(response, 'form', 'email', 'Enter a valid e-mail address.')
+ self.assertFormError(response, 'form', 'email', 'Enter a valid email address.')
def test_valid_form_with_template(self):
"POST valid data to a form using multiple templates"
@@ -263,7 +263,7 @@ def test_form_error_with_template(self):
self.assertTemplateUsed(response, 'base.html')
self.assertTemplateNotUsed(response, "Invalid POST Template")
- self.assertFormError(response, 'form', 'email', 'Enter a valid e-mail address.')
+ self.assertFormError(response, 'form', 'email', 'Enter a valid email address.')
def test_unknown_page(self):
"GET an invalid URL"
View
8 tests/regressiontests/admin_views/tests.py
@@ -897,7 +897,7 @@ def testLogin(self):
self.assertFalse(login.context)
self.client.get('/test_admin/admin/logout/')
- # Test if user enters e-mail address
+ # Test if user enters email address
response = self.client.get('/test_admin/admin/')
self.assertEqual(response.status_code, 200)
login = self.client.post('/test_admin/admin/', self.super_email_login)
@@ -907,7 +907,7 @@ def testLogin(self):
self.assertContains(login, ERROR_MESSAGE)
new_user = User(username='jondoe', password='secret', email='super@example.com')
new_user.save()
- # check to ensure if there are multiple e-mail addresses a user doesn't get a 500
+ # check to ensure if there are multiple email addresses a user doesn't get a 500
login = self.client.post('/test_admin/admin/', self.super_email_login)
self.assertContains(login, ERROR_MESSAGE)
@@ -1556,7 +1556,7 @@ def test_staff_member_required_decorator_works_as_per_admin_login(self):
# make sure the view removes test cookie
self.assertEqual(self.client.session.test_cookie_worked(), False)
- # Test if user enters e-mail address
+ # Test if user enters email address
response = self.client.get('/test_admin/admin/secure-view/')
self.assertEqual(response.status_code, 200)
login = self.client.post('/test_admin/admin/secure-view/', self.super_email_login)
@@ -1566,7 +1566,7 @@ def test_staff_member_required_decorator_works_as_per_admin_login(self):
self.assertContains(login, ERROR_MESSAGE)
new_user = User(username='jondoe', password='secret', email='super@example.com')
new_user.save()
- # check to ensure if there are multiple e-mail addresses a user doesn't get a 500
+ # check to ensure if there are multiple email addresses a user doesn't get a 500
login = self.client.post('/test_admin/admin/secure-view/', self.super_email_login)
self.assertContains(login, ERROR_MESSAGE)
View
2  tests/regressiontests/forms/tests/extra.py
@@ -613,7 +613,7 @@ class CommentForm(Form):
data = dict(email='invalid')
f = CommentForm(data, auto_id=False, error_class=DivErrorList)
self.assertHTMLEqual(f.as_p(), """<p>Name: <input type="text" name="name" maxlength="50" /></p>
-<div class="errorlist"><div class="error">Enter a valid e-mail address.</div></div>
+<div class="errorlist"><div class="error">Enter a valid email address.</div></div>
<p>Email: <input type="text" name="email" value="invalid" /></p>
<div class="errorlist"><div class="error">This field is required.</div></div>
<p>Comment: <input type="text" name="comment" /></p>""")
View
28 tests/regressiontests/forms/tests/fields.py
@@ -507,16 +507,16 @@ def test_emailfield_1(self):
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, '')
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, None)
self.assertEqual('person@example.com', f.clean('person@example.com'))
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo@')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo@bar')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'example@invalid-.com')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'example@-invalid.com')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'example@inv-.alid-.com')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'example@inv-.-alid.com')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo@')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo@bar')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'example@invalid-.com')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'example@-invalid.com')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'example@inv-.alid-.com')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'example@inv-.-alid.com')
self.assertEqual('example@valid-----hyphens.com', f.clean('example@valid-----hyphens.com'))
self.assertEqual('example@valid-with-hyphens.com', f.clean('example@valid-with-hyphens.com'))
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'example@.com')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'example@.com')
self.assertEqual('local@domain.with.idn.xyz\xe4\xf6\xfc\xdfabc.part.com', f.clean('local@domain.with.idn.xyzäöüßabc.part.com'))
def test_email_regexp_for_performance(self):
@@ -525,7 +525,7 @@ def test_email_regexp_for_performance(self):
# if the security fix isn't in place.
self.assertRaisesMessage(
ValidationError,
- "'Enter a valid e-mail address.'",
+ "'Enter a valid email address.'",
f.clean,
'viewx3dtextx26qx3d@yahoo.comx26latlngx3d15854521645943074058'
)
@@ -536,9 +536,9 @@ def test_emailfield_2(self):
self.assertEqual('', f.clean(None))
self.assertEqual('person@example.com', f.clean('person@example.com'))
self.assertEqual('example@example.com', f.clean(' example@example.com \t \t '))
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo@')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'foo@bar')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo@')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'foo@bar')
def test_emailfield_3(self):
f = EmailField(min_length=10, max_length=15)
@@ -926,7 +926,7 @@ def test_combofield_1(self):
f = ComboField(fields=[CharField(max_length=20), EmailField()])
self.assertEqual('test@example.com', f.clean('test@example.com'))
self.assertRaisesMessage(ValidationError, "'Ensure this value has at most 20 characters (it has 28).'", f.clean, 'longemailaddress@example.com')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'not an e-mail')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'not an email')
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, '')
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, None)
@@ -934,7 +934,7 @@ def test_combofield_2(self):
f = ComboField(fields=[CharField(max_length=20), EmailField()], required=False)
self.assertEqual('test@example.com', f.clean('test@example.com'))
self.assertRaisesMessage(ValidationError, "'Ensure this value has at most 20 characters (it has 28).'", f.clean, 'longemailaddress@example.com')
- self.assertRaisesMessage(ValidationError, "'Enter a valid e-mail address.'", f.clean, 'not an e-mail')
+ self.assertRaisesMessage(ValidationError, "'Enter a valid email address.'", f.clean, 'not an email')
self.assertEqual('', f.clean(''))
self.assertEqual('', f.clean(None))
View
4 tests/regressiontests/test_client_regress/tests.py
@@ -499,11 +499,11 @@ def test_unknown_error(self):
try:
self.assertFormError(response, 'form', 'email', 'Some error.')
except AssertionError as e:
- self.assertIn(str_prefix("The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid e-mail address.'])"), str(e))
+ self.assertIn(str_prefix("The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid email address.'])"), str(e))
try:
self.assertFormError(response, 'form', 'email', 'Some error.', msg_prefix='abc')
except AssertionError as e:
- self.assertIn(str_prefix("abc: The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid e-mail address.'])"), str(e))
+ self.assertIn(str_prefix("abc: The field 'email' on form 'form' in context 0 does not contain the error 'Some error.' (actual errors: [%(_)s'Enter a valid email address.'])"), str(e))
def test_unknown_nonfield_error(self):
"""
View
2  tests/regressiontests/test_utils/tests.py
@@ -476,7 +476,7 @@ def func1():
class AssertFieldOutputTests(SimpleTestCase):
def test_assert_field_output(self):
- error_invalid = ['Enter a valid e-mail address.']
+ error_invalid = ['Enter a valid email address.']
self.assertFieldOutput(EmailField, {'a@a.com': 'a@a.com'}, {'aaa': error_invalid})
self.assertRaises(AssertionError, self.assertFieldOutput, EmailField, {'a@a.com': 'a@a.com'}, {'aaa': error_invalid + ['Another error']})
self.assertRaises(AssertionError, self.assertFieldOutput, EmailField, {'a@a.com': 'Wrong output'}, {'aaa': error_invalid})
Please sign in to comment.
Something went wrong with that request. Please try again.