media_confirm_delete: redirect to next, then prev, then user home
Instead of redirecting directly to user's home. Makes the flow for mass or just a few deletions easier. For really large deletions it would still make sense to have a dedicated view, but this is still way better then losing context by jumping back to the home view. Signed-off-by: Alon Levy <alon@pobox.com>
This commit is contained in:
parent
e7c08e3550
commit
e7b8059f17
@ -301,8 +301,12 @@ def media_confirm_delete(request, media):
|
|||||||
messages.add_message(
|
messages.add_message(
|
||||||
request, messages.SUCCESS, _('You deleted the media.'))
|
request, messages.SUCCESS, _('You deleted the media.'))
|
||||||
|
|
||||||
return redirect(request, "mediagoblin.user_pages.user_home",
|
location = media.url_to_next(request.urlgen)
|
||||||
user=username)
|
if not location:
|
||||||
|
location=media.url_to_prev(request.urlgen)
|
||||||
|
if not location:
|
||||||
|
location="mediagoblin.user_pages.user_home"
|
||||||
|
return redirect(request, location=location, user=username)
|
||||||
else:
|
else:
|
||||||
messages.add_message(
|
messages.add_message(
|
||||||
request, messages.ERROR,
|
request, messages.ERROR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user