Skip to content

Commit

Permalink
Merge pull request #194 from nephila/issue_192
Browse files Browse the repository at this point in the history
Fix for issue #192. Just a tentative approach ATM
  • Loading branch information
stefanfoulis committed Jun 28, 2012
2 parents e2dac0b + 72bf8da commit 61ffdbc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion filer/admin/fileadmin.py
Expand Up @@ -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',
Expand Down

0 comments on commit 61ffdbc

Please sign in to comment.