Author: PaulM Date: 2011-09-22 15:55:47 -0700 (Thu, 22 Sep 2011) New Revision: 16891
Modified: django/branches/releases/1.3.X/django/contrib/admin/forms.py django/branches/releases/1.3.X/tests/regressiontests/admin_views/tests.py Log: [1.3.X] Reverting r16878 (improved admin error message) per advice from jezdez. refs #16837 Modified: django/branches/releases/1.3.X/django/contrib/admin/forms.py =================================================================== --- django/branches/releases/1.3.X/django/contrib/admin/forms.py 2011-09-22 22:44:00 UTC (rev 16890) +++ django/branches/releases/1.3.X/django/contrib/admin/forms.py 2011-09-22 22:55:47 UTC (rev 16891) @@ -6,8 +6,8 @@ from django.utils.translation import ugettext_lazy, ugettext as _ -ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password " - "for a staff account. Note that both fields are case-sensitive.") +ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. " + "Note that both fields are case-sensitive.") class AdminAuthenticationForm(AuthenticationForm): """ Modified: django/branches/releases/1.3.X/tests/regressiontests/admin_views/tests.py =================================================================== --- django/branches/releases/1.3.X/tests/regressiontests/admin_views/tests.py 2011-09-22 22:44:00 UTC (rev 16890) +++ django/branches/releases/1.3.X/tests/regressiontests/admin_views/tests.py 2011-09-22 22:55:47 UTC (rev 16891) @@ -38,10 +38,7 @@ Question, Answer, Inquisition, Actor, FoodDelivery, RowLevelChangePermissionModel, Paper, CoverLetter, Story, OtherStory) -ERROR_MESSAGE = "Please enter the correct username and password \ -for a staff account. Note that both fields are case-sensitive." - class AdminViewBasicTest(TestCase): fixtures = ['admin-views-users.xml', 'admin-views-colors.xml', 'admin-views-fabrics.xml', 'admin-views-books.xml'] @@ -641,12 +638,12 @@ self.assertContains(login, "Your e-mail address is not your username") # only correct passwords get a username hint login = self.client.post('/test_admin/admin/', self.super_email_bad_login) - self.assertContains(login, ERROR_MESSAGE) + self.assertContains(login, "Please enter a correct username and password.") new_user = User(username='jondoe', password='secret', email='su...@example.com') new_user.save() # check to ensure if there are multiple e-mail addresses a user doesn't get a 500 login = self.client.post('/test_admin/admin/', self.super_email_login) - self.assertContains(login, ERROR_MESSAGE) + self.assertContains(login, "Please enter a correct username and password.") # Add User request = self.client.get('/test_admin/admin/') @@ -677,7 +674,7 @@ self.assertEqual(request.status_code, 200) login = self.client.post('/test_admin/admin/', self.joepublic_login) self.assertEqual(login.status_code, 200) - self.assertContains(login, ERROR_MESSAGE) + self.assertContains(login, "Please enter a correct username and password.") # Requests without username should not return 500 errors. request = self.client.get('/test_admin/admin/') @@ -1237,12 +1234,12 @@ self.assertContains(login, "Your e-mail address is not your username") # only correct passwords get a username hint login = self.client.post('/test_admin/admin/secure-view/', self.super_email_bad_login) - self.assertContains(login, ERROR_MESSAGE) + self.assertContains(login, "Please enter a correct username and password.") new_user = User(username='jondoe', password='secret', email='su...@example.com') new_user.save() # check to ensure if there are multiple e-mail 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) + self.assertContains(login, "Please enter a correct username and password.") # Add User request = self.client.get('/test_admin/admin/secure-view/') @@ -1274,7 +1271,7 @@ login = self.client.post('/test_admin/admin/secure-view/', self.joepublic_login) self.assertEqual(login.status_code, 200) # Login.context is a list of context dicts we just need to check the first one. - self.assertContains(login, ERROR_MESSAGE) + self.assertContains(login, "Please enter a correct username and password.") # 8509 - if a normal user is already logged in, it is possible # to change user into the superuser without error -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.