Fixed a KeyError when editing a comment.
This commit is contained in:
parent
d3ff88e5cf
commit
8288455468
@ -162,7 +162,10 @@ def edit_comment(user_id, node_id, patch):
|
|||||||
log.info('User %s edited comment %s', user_id, node_id)
|
log.info('User %s edited comment %s', user_id, node_id)
|
||||||
|
|
||||||
# Fetch the new content, so the client can show these without querying again.
|
# Fetch the new content, so the client can show these without querying again.
|
||||||
node = nodes_coll.find_one(node_id, projection={'properties._content_html': 1})
|
node = nodes_coll.find_one(node_id, projection={
|
||||||
|
'properties.content': 1,
|
||||||
|
'properties._content_html': 1,
|
||||||
|
})
|
||||||
return status, node
|
return status, node
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ def comments_create():
|
|||||||
@login_required
|
@login_required
|
||||||
def comment_edit(comment_id):
|
def comment_edit(comment_id):
|
||||||
"""Allows a user to edit their comment."""
|
"""Allows a user to edit their comment."""
|
||||||
|
from pillar.web import jinja
|
||||||
|
|
||||||
api = system_util.pillar_api()
|
api = system_util.pillar_api()
|
||||||
|
|
||||||
@ -80,7 +81,8 @@ def comment_edit(comment_id):
|
|||||||
return jsonify({
|
return jsonify({
|
||||||
'status': 'success',
|
'status': 'success',
|
||||||
'data': {
|
'data': {
|
||||||
'content_html': result.properties['_content_html'],
|
'content': result.properties.content or '',
|
||||||
|
'content_html': jinja.do_markdowned(result.properties, 'content'),
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user