diff options
author | Emily O'Leary <Emma.C.Echo@gmail.com> | 2013-08-06 18:22:51 -0400 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-07 16:33:58 -0700 |
commit | 3bd62dc4ca4fb12c772729bbb9dd6a78c3c08e48 (patch) | |
tree | 451dc4a9c669421a6ba6ea554a1be447707c1d93 /mediagoblin/user_pages/views.py | |
parent | 3cf4ae0c41618fca764b80c5888c2868b8be5829 (diff) | |
download | mediagoblin-3bd62dc4ca4fb12c772729bbb9dd6a78c3c08e48.tar.lz mediagoblin-3bd62dc4ca4fb12c772729bbb9dd6a78c3c08e48.tar.xz mediagoblin-3bd62dc4ca4fb12c772729bbb9dd6a78c3c08e48.zip |
Changed how the comment was encoded/read.
Fixed CSRF + Post with comment preview.
Merged with latest master
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r-- | mediagoblin/user_pages/views.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 2bc56fd5..2e613697 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -17,7 +17,6 @@ import logging import datetime import json -import urllib from mediagoblin import messages, mg_globals from mediagoblin.db.models import (MediaEntry, MediaTag, Collection, @@ -199,15 +198,11 @@ def media_post_comment(request, media): def media_preview_comment(request): + """Runs a comment through markdown so it can be previewed.""" + comment = unicode(request.form['comment_content']) + cleancomment = { "content":cleaned_markdown_conversion(comment)} - comment = unicode(urllib.unquote(request.query_string).decode('string_escape')) - if comment.startswith('"') and comment.endswith('"'): - comment = comment[1:-1] - print comment - #decoderRing = json.JSONDecoder() - #comment = decoderRing.decode(request.query_string) - - return Response(json.dumps(cleaned_markdown_conversion(comment))) + return Response(json.dumps(cleancomment)) @get_media_entry_by_id @require_active_login |