Ticket #10530: list_editable_validationfix_2.diff

File list_editable_validationfix_2.diff, 816 bytes (added by Florian Apolloner, 16 years ago)
  • django/contrib/admin/validation.py

    diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py
    index fa6d7e3..f687a84 100644
    a b def validate(cls, model):  
    8585                raise ImproperlyConfigured("'%s' cannot be in both '%s.list_editable'"
    8686                    " and '%s.list_display_links'"
    8787                    % (field, cls.__name__, cls.__name__))
     88            if not cls.list_display_links and cls.list_display[0] in cls.list_editable:
     89                raise ImproperlyConfigured("'%s.list_editable[%d]' refers to the"
     90                    " first field in list_display, which can't be used unless"
     91                    " list_display_links is set." % (cls.__name__, idx))
     92
    8893               
    8994
    9095    # search_fields = ()
Back to Top