Ticket #18051: ticket18051.diff

File ticket18051.diff, 568 bytes (added by mateusgondim, 6 years ago)

I followed the above suggestion and replaced that line with the isinstance checking for list and tuples

  • django/contrib/admin/util.py

    diff --git a/django/contrib/admin/util.py b/django/contrib/admin/util.py
    index 9611b00..224fd86 100644
    a b def flatten_fieldsets(fieldsets): 
    8787    for name, opts in fieldsets:
    8888        for field in opts['fields']:
    8989            # type checking feels dirty, but it seems like the best way here
    90             if type(field) == tuple:
     90            if isinstance(field, (list, tuple)):
    9191                field_names.extend(field)
    9292            else:
    9393                field_names.append(field)
Back to Top