From edc7f951d1e3bdbd4aa84eedd7f114fe2df28086 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 2 Jan 2022 20:03:51 +0200 Subject: [PATCH] fsd --- files/classes/user.py | 7 +++++++ files/routes/users.py | 2 +- files/templates/userpage.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 73375f784..32b6a4887 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -220,6 +220,13 @@ class User(Base): if u not in alts: alts.append(u) return alts + @property + @lazy + def alts_patron(self): + for u in self.alts_unique: + if u.patron: return True + return False + @property @lazy def strid(self): diff --git a/files/routes/users.py b/files/routes/users.py index 3fd43af03..3d7691290 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -218,7 +218,7 @@ def transfer_coins(v, username): if v.coins < amount: return {"error": f"You don't have enough {app.config['COINS_NAME']}"}, 400 if amount < 100: return {"error": f"You have to gift at least 100 {app.config['COINS_NAME']}."}, 400 - if not v.patron and not receiver.patron: + if not v.patron and not receiver.patron and not v.alts_patron and not receiver.alts_patron: tax = math.ceil(amount*0.03) tax_receiver = g.db.query(User).filter_by(id=TAX_RECEIVER_ID).one_or_none() tax_receiver.coins += tax diff --git a/files/templates/userpage.html b/files/templates/userpage.html index fd49e523b..35b0170c7 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -691,7 +691,7 @@ {% endif %} {% if v %} -
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
+
{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}
{{u.username}}
{% endif %}