Permalink
Browse files

Merge pull request #194 from nephila/issue_192

Fix for issue #192. Just a tentative approach ATM
  • Loading branch information...
2 parents e2dac0b + 72bf8da commit 61ffdbc0c982a1969d11679dea469d448e0dd493 @stefanfoulis stefanfoulis committed Jun 28, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 filer/admin/fileadmin.py
@@ -34,10 +34,16 @@ def response_change(self, request, obj):
Overrides the default to be able to forward to the directory listing
instead of the default change_list_view
"""
+ ## Code borrowed from django ModelAdmin to determine changelist on the fly
+ opts = obj._meta
+ module_name = opts.module_name
+ post_url = reverse('admin:%s_%s_changelist' %
+ (opts.app_label, module_name),
+ current_app=self.admin_site.name)
r = super(FileAdmin, self).response_change(request, obj)
if r['Location']:
# it was a successful save
- if r['Location'] in ['../']:
+ if r['Location'] in ['../'] or r['Location'] == post_url:
# this means it was a save: redirect to the directory view
if obj.folder:
url = reverse('admin:filer-directory_listing',

0 comments on commit 61ffdbc

Please sign in to comment.