Ticket #17498: admin.sites.patch

File admin.sites.patch, 1.5 KB (added by kace, 12 years ago)

small patch for "no_index" meta option

  • django/contrib/admin/sites.py

    old new  
    354354            app_label = model._meta.app_label
    355355            has_module_perms = user.has_module_perms(app_label)
    356356
    357             if has_module_perms:
     357            if has_module_perms and not hasattr(model._meta, 'no_index') :
    358358                perms = model_admin.get_model_perms(request)
    359359
    360360                # Check whether user has any perm for this module.
     
    415415        app_dict = {}
    416416        for model, model_admin in self._registry.items():
    417417            if app_label == model._meta.app_label:
    418                 if has_module_perms:
     418                if has_module_perms and not hasattr(model._meta, 'no_index') :
    419419                    perms = model_admin.get_model_perms(request)
    420420
    421421                    # Check whether user has any perm for this module.
  • django/db/models/options.py

    old new  
    1717DEFAULT_NAMES = ('verbose_name', 'verbose_name_plural', 'db_table', 'ordering',
    1818                 'unique_together', 'permissions', 'get_latest_by',
    1919                 'order_with_respect_to', 'app_label', 'db_tablespace',
    20                  'abstract', 'managed', 'proxy', 'auto_created')
     20                 'abstract', 'managed', 'proxy', 'auto_created', 'no_index')
    2121
    2222class Options(object):
    2323    def __init__(self, meta, app_label=None):
Back to Top