From abbf1ffe9779a67aa60ca6821882ac5bf4742269 Mon Sep 17 00:00:00 2001
From: Rifo Genadi <rifoagenadi@gmail.com>
Date: Fri, 26 Apr 2019 04:05:33 +0700
Subject: [PATCH] Fix add comment bug

---
 modules/comment.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/comment.py b/modules/comment.py
index 47871bf..3617cee 100644
--- a/modules/comment.py
+++ b/modules/comment.py
@@ -37,13 +37,14 @@ def add_comment(user):
     text = req.get("text")
     try:
         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()
         return jsonify({
             "status":200,
             "message":"comment added successfully"
         })
     except Exception as e:
+        print(str(e))
         return jsonify({
             "status":500,
             "message":str(e)
-- 
GitLab