Skip to content

Commit

Permalink
ADD owned_by_me to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Aug 23, 2023
1 parent b947235 commit fa63577
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/anubis/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit fa63577

Please sign in to comment.