From fa63577df26cafe9774d4a8ae7848a771ced35cc Mon Sep 17 00:00:00 2001 From: John McCann Cunniff Jr Date: Wed, 23 Aug 2023 17:07:35 -0400 Subject: [PATCH] ADD owned_by_me to comments --- api/anubis/models/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/anubis/models/__init__.py b/api/anubis/models/__init__.py index c3595842..ea964a62 100644 --- a/api/anubis/models/__init__.py +++ b/api/anubis/models/__init__.py @@ -1209,12 +1209,14 @@ class ForumPostComment(db.Model): @property def meta_data(self): + from anubis.utils.auth.user import current_user return { "id": self.id, "anonymous": self.anonymous, "display_name": "Anonymous" if self.anonymous else self.owner.name, "post_id": self.post_id, "parent_id": self.parent_id, + "owned_by_me": self.owner_id == current_user.id, "approved_by": self.approved_by.name if self.approved_by_id is not None else None, "thread_start": self.thread_start, "created": str(self.created),