summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 17:32:07 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 17:32:07 +0000
commita599e50b07cb9ec64ebc06a7fdb7b47ed7d762bb (patch)
tree8f07648349d739638b400dae4fa64871b1585d13 /django/core
parent651082267956cef3bf3dbd48c5314046c14ca01c (diff)
[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
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/validation.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/validation.py b/django/core/management/validation.py
index bbea35b5ce..bc2856c127 100644
--- a/django/core/management/validation.py
+++ b/django/core/management/validation.py
@@ -62,7 +62,7 @@ def get_validation_errors(outfile, app=None):
e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name)
else:
for c in f.choices:
- if not type(c) in (tuple, list) or len(c) != 2:
+ if not isinstance(c, (list, tuple)) or len(c) != 2:
e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name)
if f.db_index not in (None, True, False):
e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name)