mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Changed django.forms.ValidationError imports to django.core.exceptions.ValidationError.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
2788de95e3
commit
9ef4a18dbe
@@ -1,6 +1,6 @@
|
||||
from django import forms
|
||||
from django.contrib.admin.forms import AdminAuthenticationForm
|
||||
from django.contrib.admin.helpers import ActionForm
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
|
||||
class CustomAdminAuthenticationForm(AdminAuthenticationForm):
|
||||
@@ -11,7 +11,7 @@ class CustomAdminAuthenticationForm(AdminAuthenticationForm):
|
||||
def clean_username(self):
|
||||
username = self.cleaned_data.get('username')
|
||||
if username == 'customform':
|
||||
raise forms.ValidationError('custom form error')
|
||||
raise ValidationError('custom form error')
|
||||
return username
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user