From 4d63aa70a56ddf3a908bc8c13adfd570e131ecae Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 1 Sep 2021 17:01:04 +0200 Subject: [PATCH] hggh --- files/routes/front.py | 2 +- files/routes/users.py | 1 + files/templates/userpage_private.html | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 36a393c9c..a6acd6bb0 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -147,7 +147,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' secondrange = firstrange+200 posts = posts[firstrange:secondrange] - if v and v.hidevotedon: posts = [x for x in posts if not (hasattr(x, 'voted') and x.voted != 0)] + if v and v.hidevotedon: posts = [x for x in posts if not hasattr(x, 'voted') or x.voted == 0] words = ['captainmeta4', ' cm4 ', 'dissident001', 'ladine'] diff --git a/files/routes/users.py b/files/routes/users.py index 4247d6707..de2ba665f 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -25,6 +25,7 @@ beams_client = PushNotifications( @app.post("/pay_rent") @auth_required def pay_rent(v): + if v.coins < 500: return "You must have more than 500 coins." v.coins -= 500 v.rent_utc = int(time.time()) g.db.add(v) diff --git a/files/templates/userpage_private.html b/files/templates/userpage_private.html index 703a72b3f..9f001c0d0 100644 --- a/files/templates/userpage_private.html +++ b/files/templates/userpage_private.html @@ -12,7 +12,9 @@

This account is private

This user has enabled private mode to cloak their posting history.

{% if u.id == 253 and 'rdrama' in request.host %} - Pay rent to view profile (500 coins) + {% if v and v.coins > 500 and not v.is_suspended %} + Pay rent to view profile (500 coins) + {% endif %}

 				{% if v and v.coins > 5000 and time - v.created_utc > 604800 and not v.is_suspended %}
 					Attempt to steal coins