Make sure you can't force comments on entries that don't exist.
See: http://bugs.foocorp.net/issues/621
This commit is contained in:
parent
3d670ed035
commit
95e12bf231
@ -124,13 +124,17 @@ def media_home(request, media, page, **kwargs):
|
|||||||
'app_config': mg_globals.app_config})
|
'app_config': mg_globals.app_config})
|
||||||
|
|
||||||
|
|
||||||
|
@get_user_media_entry
|
||||||
@require_active_login
|
@require_active_login
|
||||||
def media_post_comment(request):
|
def media_post_comment(request, media):
|
||||||
"""
|
"""
|
||||||
recieves POST from a MediaEntry() comment form, saves the comment.
|
recieves POST from a MediaEntry() comment form, saves the comment.
|
||||||
"""
|
"""
|
||||||
|
print "bloof!"
|
||||||
|
assert request.method == 'POST'
|
||||||
|
|
||||||
comment = request.db.MediaComment()
|
comment = request.db.MediaComment()
|
||||||
comment['media_entry'] = ObjectId(request.matchdict['media'])
|
comment['media_entry'] = media['_id']
|
||||||
comment['author'] = request.user['_id']
|
comment['author'] = request.user['_id']
|
||||||
comment['content'] = unicode(request.POST['comment_content'])
|
comment['content'] = unicode(request.POST['comment_content'])
|
||||||
comment['content_html'] = cleaned_markdown_conversion(comment['content'])
|
comment['content_html'] = cleaned_markdown_conversion(comment['content'])
|
||||||
@ -147,9 +151,8 @@ def media_post_comment(request):
|
|||||||
request, messages.SUCCESS,
|
request, messages.SUCCESS,
|
||||||
_('Comment posted!'))
|
_('Comment posted!'))
|
||||||
|
|
||||||
return redirect(request, 'mediagoblin.user_pages.media_home',
|
return exc.HTTPFound(
|
||||||
media = request.matchdict['media'],
|
location=media.url_for_self(request.urlgen))
|
||||||
user = request.matchdict['user'])
|
|
||||||
|
|
||||||
|
|
||||||
@get_user_media_entry
|
@get_user_media_entry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user