burke-software / django-mass-edit

Make bulk changes in the Django admin interface
156 stars 68 forks source link

Custom change form template breaks mass edit #82

Closed andreynovikov closed 2 years ago

andreynovikov commented 4 years ago

I wonder what is the point in this line: https://github.com/burke-software/django-mass-edit/blob/f69a639fac9912f355726bf051793acb843bdaf8/massadmin/massadmin.py#L189

If I define custom change form for my model admin, mass edit becomes completely broken. If I remove this line from massadmin.py everything returns to normal.

daris commented 4 years ago

Same problem here, is it possible to somehow workaround this?

daris commented 4 years ago

My quick workaround for this issue is to set change_form_template inside overridden render_change_form method instead of in ModelAdmin class directly (so this template will be used only for change form and not for mass edit form):

    def render_change_form(self, *args, **kwargs):
        self.change_form_template = 'custom_change_form.html'
        return super().render_change_form(*args, **kwargs)
PetrDlouhy commented 2 years ago

Is this issue solved by MR #96?

PetrDlouhy commented 2 years ago

I am closing this issue as my last question remained without answer.

If the issue still persist in current version of django-mass-edit, feel free to reopen this issue, but please define what completely broken exactly means.