1
0
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:
François Freitag
2020-02-12 14:48:49 +01:00
committed by Mariusz Felisiak
parent 2788de95e3
commit 9ef4a18dbe
48 changed files with 164 additions and 133 deletions

View File

@@ -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