Ticket #11859: t11859.diff

File t11859.diff, 844 bytes (added by Alex Gaynor, 8 years ago)
  • django/core/management/validation.py

    diff --git a/django/core/management/validation.py b/django/core/management/validation.py
    index 9b65b8e..ddf454f 100644
    a b 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)
Back to Top