diff options
author | Matthias Kestenholz <mk@feinheit.ch> | 2018-11-10 00:52:30 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-11-09 18:52:30 -0500 |
commit | f9ff1df1daac8ae1fc22b27f48735148cb5488dd (patch) | |
tree | 87ff7dbda0dfcb0a896c892ef441cffa4f8c401f /django/contrib/admin/options.py | |
parent | a375e911efcc78054d09ef31422e081507e56623 (diff) | |
download | django-f9ff1df1daac8ae1fc22b27f48735148cb5488dd.tar.gz |
Fixed #29917 -- Stopped collecting ModelAdmin.actions from base ModelAdmins.
Diffstat (limited to 'django/contrib/admin/options.py')
-rw-r--r-- | django/contrib/admin/options.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 241d22e82a..3a228516cc 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -859,13 +859,8 @@ class ModelAdmin(BaseModelAdmin): for (name, func) in self.admin_site.actions: description = getattr(func, 'short_description', name.replace('_', ' ')) actions.append((func, name, description)) - - # Then gather them from the model admin and all parent classes, - # starting with self and working back up. - for klass in self.__class__.mro()[::-1]: - class_actions = getattr(klass, 'actions', []) or [] - actions.extend(self.get_action(action) for action in class_actions) - + # Add actions from this ModelAdmin. + actions.extend(self.get_action(action) for action in self.actions or []) # get_action might have returned None, so filter any of those out. return filter(None, actions) |