mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #7885 -- Prevent duplicates in fields and fieldsets declarations. Thanks julien and wamberg for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -346,6 +346,20 @@ Traceback (most recent call last):
|
||||
...
|
||||
ImproperlyConfigured: Both fieldsets and fields are specified in ValidationTestModelAdmin.
|
||||
|
||||
>>> class ValidationTestModelAdmin(ModelAdmin):
|
||||
... fieldsets = [(None, {'fields': ['name', 'name']})]
|
||||
>>> validate(ValidationTestModelAdmin, ValidationTestModel)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ImproperlyConfigured: There are duplicate field(s) in ValidationTestModelAdmin.fieldsets
|
||||
|
||||
>>> class ValidationTestModelAdmin(ModelAdmin):
|
||||
... fields = ["name", "name"]
|
||||
>>> validate(ValidationTestModelAdmin, ValidationTestModel)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ImproperlyConfigured: There are duplicate field(s) in ValidationTestModelAdmin.fields
|
||||
|
||||
# form
|
||||
|
||||
>>> class FakeForm(object):
|
||||
|
||||
Reference in New Issue
Block a user