Skip to content

Commit

Permalink
Merge pull request #9 from jphacks/comment-dev
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
kakudo415 committed Oct 23, 2021
2 parents 534d68a + 0879906 commit 4024ca3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app.py
Expand Up @@ -33,7 +33,7 @@ def post_comment():
comment = json.loads(request.data)
new_comment = Comment(
comment_id=str(random.randint(1, 100000)),
parent_comment_id=comment["parent_comment_id"],
parent_comment_id=str(comment["parent_comment_id"]),
title=comment["title"],
text=comment["text"],
attribute=comment["attribute"],
Expand All @@ -60,7 +60,7 @@ def get_comment(comment_id):


@app.route("/comments", methods=["GET"])
def get_comment_all():
def get_comments():
return render_template(
"comments.html",
comments=Comment.query.order_by(Comment.comment_id.desc()).all(),
Expand Down
2 changes: 1 addition & 1 deletion templates/comments.html
Expand Up @@ -9,7 +9,7 @@

<body>
{% for comment in comments %}
<p>{{comment.parents_comment_id}} {{comment.comment_id}} {{comment.title}} {{comment.text}} {{comment.attribute}}</p>
<p>{{comment.parent_comment_id}} {{comment.comment_id}} {{comment.title}} {{comment.text}} {{comment.attribute}}</p>
{% endfor %}
</body>

Expand Down

0 comments on commit 4024ca3

Please sign in to comment.