Skip to content
Snippets Groups Projects
Commit abbf1ffe authored by Rifo Genadi's avatar Rifo Genadi
Browse files

Fix add comment bug

parent 808c171a
Branches
1 merge request!5Develop
Pipeline #14068 failed with stage
...@@ -37,13 +37,14 @@ def add_comment(user): ...@@ -37,13 +37,14 @@ def add_comment(user):
text = req.get("text") text = req.get("text")
try: try:
page = db.VizData.objects.with_id(page_id) page = db.VizData.objects.with_id(page_id)
new_comment = db.Comment(commenter_id = user.id, commenter_name=user.name, comment_text=text, page = page) new_comment = db.Comment(commenter_id = user.id, commenter_name=user.name, comment_text=text, page = page.id)
new_comment.save() new_comment.save()
return jsonify({ return jsonify({
"status":200, "status":200,
"message":"comment added successfully" "message":"comment added successfully"
}) })
except Exception as e: except Exception as e:
print(str(e))
return jsonify({ return jsonify({
"status":500, "status":500,
"message":str(e) "message":str(e)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment