aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/views.py
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2011-06-30 11:48:52 +0200
committerJoar Wandborg <git@wandborg.com>2011-06-30 11:48:52 +0200
commit40d18ad4c6d66d6db1aaf43df8d6ba23d162f77f (patch)
treeafcddc7b5224e830c1bc54a329db95e6a00babfc /mediagoblin/user_pages/views.py
parent47f524f67d90245521cb6214e269e89f06daeaf2 (diff)
parent52359e9103e85e153e3012332e59bd64abf83dbc (diff)
downloadmediagoblin-40d18ad4c6d66d6db1aaf43df8d6ba23d162f77f.tar.lz
mediagoblin-40d18ad4c6d66d6db1aaf43df8d6ba23d162f77f.tar.xz
mediagoblin-40d18ad4c6d66d6db1aaf43df8d6ba23d162f77f.zip
Merge branch 'master' of http://git.gitorious.org/mediagoblin/mediagoblin
Diffstat (limited to 'mediagoblin/user_pages/views.py')
-rw-r--r--mediagoblin/user_pages/views.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 67a57d97..399d2020 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -15,9 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from webob import exc
+
+from mediagoblin import messages
from mediagoblin.db.util import DESCENDING, ObjectId
-from mediagoblin.util import Pagination, render_to_response, redirect, \
- clean_html
+from mediagoblin.util import (
+ Pagination, render_to_response, redirect, cleaned_markdown_conversion)
from mediagoblin.user_pages import forms as user_forms
from mediagoblin.decorators import uses_pagination, get_user_media_entry, \
@@ -25,7 +27,6 @@ from mediagoblin.decorators import uses_pagination, get_user_media_entry, \
from werkzeug.contrib.atom import AtomFeed
-import markdown
@uses_pagination
def user_home(request, page):
@@ -101,6 +102,7 @@ def media_home(request, media, **kwargs):
'pagination': pagination,
'comment_form': comment_form})
+
@require_active_login
def media_post_comment(request):
"""
@@ -111,18 +113,19 @@ def media_post_comment(request):
comment['author'] = request.user['_id']
comment['content'] = request.POST['comment']
- md = markdown.Markdown(
- safe_mode = 'escape')
- comment['content_html'] = clean_html(
- md.convert(
- comment['content']))
+ comment['content_html'] = cleaned_markdown_conversion(comment['content'])
comment.save()
+ messages.add_message(
+ request, messages.SUCCESS,
+ 'Comment posted!')
+
return redirect(request, 'mediagoblin.user_pages.media_home',
media = request.matchdict['media'],
user = request.matchdict['user'])
+
ATOM_DEFAULT_NR_OF_UPDATED_ITEMS = 5
def atom_feed(request):