Skip to content

Commit

Permalink
Fix for django 1.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Mar 6, 2012
1 parent d194974 commit f3cc72a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions categories/editor/tree_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ def old_changelist_view(self, request, extra_context=None):
pass

try:
cl = TreeChangeList(request, self.model, list_display,
self.list_display_links, self.list_filter, self.date_hierarchy,
self.search_fields, self.list_select_related,
self.list_per_page, self.list_max_show_all,
self.list_editable, self)
if django.VERSION[1] < 4:
params = (request, self.model, list_display,
self.list_display_links, self.list_filter, self.date_hierarchy,
self.search_fields, self.list_select_related,
self.list_per_page,self.list_editable, self)
else:
params = (request, self.model, list_display,
self.list_display_links, self.list_filter, self.date_hierarchy,
self.search_fields, self.list_select_related,
self.list_per_page, self.list_max_show_all,
self.list_editable, self)
cl = TreeChangeList(*params)
except IncorrectLookupParameters:
# Wacky lookup parameters were given, so redirect to the main
# changelist page, without parameters, and pass an 'invalid=1'
Expand Down

0 comments on commit f3cc72a

Please sign in to comment.