Fix parameters to inherited change_view function
authorMagnus Hagander <magnus@hagander.net>
Sat, 25 May 2013 18:17:22 +0000 (14:17 -0400)
committerMagnus Hagander <magnus@hagander.net>
Sun, 16 Jun 2013 14:35:21 +0000 (16:35 +0200)
Must be the same as in in the inherited-from class, or we ended up
passing a python dict as a string, and render the contents of it as
the "action" attribute on the form.

pgweb/util/admin.py

index 371de9e764dcf34c229da6b17e66e2799e7a14c4..186d1200d220001c5531bb0af894a0f04c194741 100644 (file)
@@ -27,14 +27,14 @@ class PgwebAdmin(admin.ModelAdmin):
                                fld.widget.attrs['class'] = fld.widget.attrs['class'] + ' markdown_preview'
                return fld
 
-       def change_view(self, request, object_id, extra_context=None):
+       def change_view(self, request, object_id, form_url='', extra_context=None):
                if self.model.send_notification:
                        # Anything that sends notification supports manual notifications
                        if extra_context == None:
                                extra_context = dict()
                        extra_context['notifications'] = ModerationNotification.objects.filter(objecttype=self.model.__name__, objectid=object_id).order_by('date')
 
-               return super(PgwebAdmin, self).change_view(request, object_id, extra_context)
+               return super(PgwebAdmin, self).change_view(request, object_id, form_url, extra_context)
 
        # Remove the builtin delete_selected action, so it doesn't
        # conflict with the custom one.