Permalink
Browse files

update PageAdmin.change_view args to match parent class

  • Loading branch information...
1 parent c7a57c7 commit 0180b7ad2fbcfe191eaa16d92716f6d2876401c0 @tomscytale tomscytale committed with Mar 5, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 cms/admin/pageadmin.py
View
@@ -495,7 +495,7 @@ def add_view(self, request, form_url='', extra_context=None):
})
return super(PageAdmin, self).add_view(request, form_url, extra_context)
- def change_view(self, request, object_id, extra_context=None):
+ def change_view(self, request, object_id, form_url='', extra_context=None):
"""
The 'change' admin view for the Page model.
"""
@@ -534,7 +534,13 @@ def change_view(self, request, object_id, extra_context=None):
}
extra_context = self.update_language_tab_context(request, obj, extra_context)
tab_language = request.GET.get("language", None)
- response = super(PageAdmin, self).change_view(request, object_id, extra_context=extra_context)
+ try:
+ # Django >= 1.4
+ response = super(PageAdmin, self).change_view(request, object_id, form_url=form_url,
+ extra_context=extra_context)
+ except TypeError:
+ response = super(PageAdmin, self).change_view(request, object_id,
+ extra_context=extra_context)
if tab_language and response.status_code == 302 and response._headers['location'][1] == request.path :
location = response._headers['location']

0 comments on commit 0180b7a

Please sign in to comment.