Return to media collection page if no collection selected

schendje rightly pointed out that we should not return to the media
homepage if we did not select a collection on the "collect" page, but
should actually return to the collect page.

This is an improvement of the user experience ;-)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2013-01-17 22:37:41 +01:00
parent 626a093ccc
commit ba5ea989a5

View File

@ -226,6 +226,10 @@ def media_collect(request, media):
messages.add_message( messages.add_message(
request, messages.ERROR, request, messages.ERROR,
_('You have to select or add a collection')) _('You have to select or add a collection'))
return redirect(request, "mediagoblin.user_pages.media_collect",
user=media.get_uploader.username,
media=media.id)
# Check whether media already exists in collection # Check whether media already exists in collection
elif CollectionItem.query.filter_by( elif CollectionItem.query.filter_by(