aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r--mediagoblin/user_pages/views.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 30c78a38..dea47fbf 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -110,12 +110,13 @@ def media_home(request, media, page, **kwargs):
"""
'Homepage' of a MediaEntry()
"""
- if request.matchdict.get('comment', None):
+ comment_id = request.matchdict.get('comment', None)
+ if comment_id:
pagination = Pagination(
page, media.get_comments(
mg_globals.app_config['comments_ascending']),
MEDIA_COMMENTS_PER_PAGE,
- request.matchdict.get('comment'))
+ comment_id)
else:
pagination = Pagination(
page, media.get_comments(
@@ -226,6 +227,10 @@ def media_collect(request, media):
messages.add_message(
request, messages.ERROR,
_('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
elif CollectionItem.query.filter_by(