I am upgrading a Django project from Django 1.11. I have successfully upgraded the project upto Django 2.1. When I upgraded to Django 2.2, I got this error message "(admin.E130) name attributes of actions defined in class AdimClass(not real name) must be unique"
The admins classes are
class AAdmin(admin.ModelAdmin)
def custom_action(self, request, queryset):
# perform custom action
.....
def custom_action_2(self, request, queryset):
# another custom actions
.....
action = [custom_action, custom_action_2]
class BAdmin(AAdmin):
def custom_action(self, request, queryset):
# performs different actions but has the same name as AAdmin action
.....
actions = AAdmin.actions + [custom_action]
problem: (admin.E130) name attributes of actions defined in class AdimClass(not real name) must be unique
If I remove the custom_action from AAdmin, the error is resolved but the action is no more available for other classes which inherits AAdmin.
Goal: keep the action in parent class AAdmin and override it on child class BAdmin.
Note: The code is working fine upto Django 2.1.