1
0
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:
Brian Rosner
2008-08-01 18:55:43 +00:00
parent 64f5ab67a5
commit be17a801f6
2 changed files with 24 additions and 1 deletions

View File

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