From d2fd058be78497414c4c459b854f11c724f3f58d Mon Sep 17 00:00:00 2001 From: Andrew Shu Date: Tue, 19 Aug 2025 15:12:59 -0700 Subject: [PATCH] Rename is_new to new_comment in API --- tildes/openapi_beta.yaml | 2 +- tildes/tildes/views/api/beta/comment.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tildes/openapi_beta.yaml b/tildes/openapi_beta.yaml index 5b7bf78..5204d74 100644 --- a/tildes/openapi_beta.yaml +++ b/tildes/openapi_beta.yaml @@ -385,7 +385,7 @@ components: by_me: type: boolean nullable: true - is_new: + new_comment: type: boolean nullable: true voted: diff --git a/tildes/tildes/views/api/beta/comment.py b/tildes/tildes/views/api/beta/comment.py index f539693..e57b355 100644 --- a/tildes/tildes/views/api/beta/comment.py +++ b/tildes/tildes/views/api/beta/comment.py @@ -17,7 +17,7 @@ def comment_to_dict(request: Request, comment: Comment) -> dict: exemplary = None by_op = None by_me = None - is_new = None + is_new_comment = None if request.has_permission("view", comment): author = comment.user.username rendered_html = comment.rendered_html @@ -25,7 +25,7 @@ def comment_to_dict(request: Request, comment: Comment) -> dict: by_me = request.user == comment.user if request.user else False if request.has_permission("view_author", comment.topic): by_op = comment.user == comment.topic.user - is_new = ( + is_new_comment = ( (comment.created_time > comment.topic.last_visit_time) if ( hasattr(comment.topic, "last_visit_time") @@ -60,7 +60,7 @@ def comment_to_dict(request: Request, comment: Comment) -> dict: ), "by_op": by_op, "by_me": by_me, - "is_new": is_new, + "new_comment": is_new_comment, "voted": comment.user_voted, "bookmarked": comment.user_bookmarked, }