mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #8342 -- Removed code from the admin that assumed that you can't login with an email address (nixed by r12634). Also refactored login code slightly to be DRY by using more of auth app's forms and views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
10
tests/regressiontests/admin_views/forms.py
Normal file
10
tests/regressiontests/admin_views/forms.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django import forms
|
||||
from django.contrib.admin.forms import AdminAuthenticationForm
|
||||
|
||||
class CustomAdminAuthenticationForm(AdminAuthenticationForm):
|
||||
|
||||
def clean_username(self):
|
||||
username = self.cleaned_data.get('username')
|
||||
if username == 'customform':
|
||||
raise forms.ValidationError('custom form error')
|
||||
return username
|
||||
Reference in New Issue
Block a user