This commit is contained in:
fireworks88 2021-07-30 20:40:15 +02:00
parent 0195b174e4
commit a88b14488b
2 changed files with 24 additions and 5 deletions

View file

@ -295,6 +295,21 @@ class User(Base, Stndrd, Age_times):
return f"Unban in {text}"
@property
@lazy
def display_awards(self):
_awards = {}
for a in self.awards:
if a.kind in _awards:
_awards[a.kind]['count'] += 1
else:
_awards[a.kind] = a.type
_awards[a.kind]['count'] = 1
return list(_awards.values())
@property
@lazy
def post_notifications_count(self):