forked from rDrama/rDrama
fddf
parent
8c625cd063
commit
2dce325a5a
|
@ -195,6 +195,17 @@ class User(Base, Stndrd, Age_times):
|
|||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def user_awards(v):
|
||||
|
||||
return_value = list(AWARDS.values())
|
||||
|
||||
user_awards = v.awards
|
||||
for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
|
||||
|
||||
return jsonify(return_value)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def referral_count(self):
|
||||
|
@ -657,15 +668,4 @@ class ViewerRelationship(Base):
|
|||
return f"{months}mo ago"
|
||||
else:
|
||||
years = int(months / 12)
|
||||
return f"{years}yr ago"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def user_awards(v):
|
||||
|
||||
return_value = list(AWARDS.values())
|
||||
|
||||
user_awards = v.awards
|
||||
for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
|
||||
|
||||
return jsonify(return_value)
|
||||
return f"{years}yr ago"
|
Loading…
Reference in New Issue