Skip to content

Commit a599e50

Browse files
committed
[1.1.X] Fixed #11859. Allowed subclasses of tuple or list for choice options. Backport of r12535 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 6510822 commit a599e50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django/core/management/validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_validation_errors(outfile, app=None):
6262
e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name)
6363
else:
6464
for c in f.choices:
65-
if not type(c) in (tuple, list) or len(c) != 2:
65+
if not isinstance(c, (list, tuple)) or len(c) != 2:
6666
e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name)
6767
if f.db_index not in (None, True, False):
6868
e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name)

0 commit comments

Comments
 (0)