Loading django/contrib/admin/checks.py +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ class BaseModelAdminChecks(object): ) ] elif not isinstance(fieldset[1]['fields'], (list, tuple)): return must_be('a list or tuple', option="fieldsets[1]['fields']", obj=cls, id='admin.E008') return must_be('a list or tuple', option="%s[1]['fields']" % label, obj=cls, id='admin.E008') fields = flatten(fieldset[1]['fields']) if len(fields) != len(set(fields)): Loading tests/admin_checks/tests.py +4 −4 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_fieldsets_fields_non_tuple(self): """ Tests for a tuple/list within fieldsets[1]['fields']. Tests for a tuple/list for the first fieldset's fields. """ class NotATupleAdmin(admin.ModelAdmin): list_display = ["pk", "title"] Loading @@ -139,7 +139,7 @@ class SystemChecksTestCase(SimpleTestCase): errors = NotATupleAdmin.check(model=Song) expected = [ checks.Error( "The value of 'fieldsets[1]['fields']' must be a list or tuple.", "The value of 'fieldsets[0][1]['fields']' must be a list or tuple.", hint=None, obj=NotATupleAdmin, id='admin.E008', Loading @@ -149,7 +149,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_nonfirst_fieldset(self): """ Tests for a tuple/list within the second fieldsets[2]['fields']. Tests for a tuple/list for the second fieldset's fields. """ class NotATupleAdmin(admin.ModelAdmin): fieldsets = [ Loading @@ -164,7 +164,7 @@ class SystemChecksTestCase(SimpleTestCase): errors = NotATupleAdmin.check(model=Song) expected = [ checks.Error( "The value of 'fieldsets[1]['fields']' must be a list or tuple.", "The value of 'fieldsets[1][1]['fields']' must be a list or tuple.", hint=None, obj=NotATupleAdmin, id='admin.E008', Loading Loading
django/contrib/admin/checks.py +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ class BaseModelAdminChecks(object): ) ] elif not isinstance(fieldset[1]['fields'], (list, tuple)): return must_be('a list or tuple', option="fieldsets[1]['fields']", obj=cls, id='admin.E008') return must_be('a list or tuple', option="%s[1]['fields']" % label, obj=cls, id='admin.E008') fields = flatten(fieldset[1]['fields']) if len(fields) != len(set(fields)): Loading
tests/admin_checks/tests.py +4 −4 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_fieldsets_fields_non_tuple(self): """ Tests for a tuple/list within fieldsets[1]['fields']. Tests for a tuple/list for the first fieldset's fields. """ class NotATupleAdmin(admin.ModelAdmin): list_display = ["pk", "title"] Loading @@ -139,7 +139,7 @@ class SystemChecksTestCase(SimpleTestCase): errors = NotATupleAdmin.check(model=Song) expected = [ checks.Error( "The value of 'fieldsets[1]['fields']' must be a list or tuple.", "The value of 'fieldsets[0][1]['fields']' must be a list or tuple.", hint=None, obj=NotATupleAdmin, id='admin.E008', Loading @@ -149,7 +149,7 @@ class SystemChecksTestCase(SimpleTestCase): def test_nonfirst_fieldset(self): """ Tests for a tuple/list within the second fieldsets[2]['fields']. Tests for a tuple/list for the second fieldset's fields. """ class NotATupleAdmin(admin.ModelAdmin): fieldsets = [ Loading @@ -164,7 +164,7 @@ class SystemChecksTestCase(SimpleTestCase): errors = NotATupleAdmin.check(model=Song) expected = [ checks.Error( "The value of 'fieldsets[1]['fields']' must be a list or tuple.", "The value of 'fieldsets[1][1]['fields']' must be a list or tuple.", hint=None, obj=NotATupleAdmin, id='admin.E008', Loading