only show the last 4 emoji awards

pull/211/head
Aevann 2023-10-04 16:54:19 +03:00
parent dc7970db23
commit 9a56f661b8
2 changed files with 4 additions and 4 deletions

View File

@ -317,8 +317,8 @@ class Comment(Base):
@lazy
def emoji_award_emojis(self, v, OVER_18_EMOJIS):
if g.show_over_18:
return [x.note for x in self.awards if x.kind == "emoji"]
return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS]
return [x.note for x in self.awards if x.kind == "emoji"][-4:]
return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS][-4:]
@property
@lazy

View File

@ -265,8 +265,8 @@ class Post(Base):
@lazy
def emoji_award_emojis(self, v, OVER_18_EMOJIS):
if g.show_over_18:
return [x.note for x in self.awards if x.kind == "emoji"]
return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS]
return [x.note for x in self.awards if x.kind == "emoji"][-4:]
return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS][-4:]
@lazy
def realurl(self, v):