mirror of
https://github.com/django/django.git
synced 2025-11-02 04:48:33 +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:
parent
07705ca129
commit
cc64fb5c4b
12 changed files with 296 additions and 216 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue