Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit a599e50b07cb9ec64ebc06a7fdb7b47ed7d762bb 1 parent 6510822
Joseph Kocherhans authored February 23, 2010

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/management/validation.py
2  django/core/management/validation.py
@@ -62,7 +62,7 @@ def get_validation_errors(outfile, app=None):
62 62
                     e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name)
63 63
                 else:
64 64
                     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:
66 66
                             e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name)
67 67
             if f.db_index not in (None, True, False):
68 68
                 e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name)

0 notes on commit a599e50

Please sign in to comment.
Something went wrong with that request. Please try again.