Render 404 if not ajax request

This commit is contained in:
Rodney Ewing 2013-08-07 17:13:38 -07:00
parent b2d6c45850
commit 202d951c3d

View File

@ -199,6 +199,10 @@ def media_post_comment(request, media):
def media_preview_comment(request):
"""Runs a comment through markdown so it can be previewed."""
# If this isn't an ajax request, render_404
if not request.is_xhr:
return render_404(request)
comment = unicode(request.form['comment_content'])
cleancomment = { "content":cleaned_markdown_conversion(comment)}