This commit is contained in:
Aevann1 2022-04-05 21:08:06 +02:00
parent ad9b8ec4dd
commit a2108bb5eb
16 changed files with 24 additions and 30 deletions

View file

@ -193,6 +193,23 @@ class User(Base):
return time.strftime("%d %b %Y", time.gmtime(self.created_utc))
@property
@lazy
def discount(self):
if self.patron == 1: discount = 0.90
elif self.patron == 2: discount = 0.85
elif self.patron == 3: discount = 0.80
elif self.patron == 4: discount = 0.75
elif self.patron == 5: discount = 0.70
elif self.patron == 6: discount = 0.65
else: discount = 1
for badge in [69,70,71,72,73]:
if self.has_badge(badge): discount -= discounts[badge]
return discount
@property
@lazy
def user_awards(self):