diff --git a/files/classes/user.py b/files/classes/user.py index 1bbcac662..1b29399f2 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1091,7 +1091,7 @@ class User(Base): @property @lazy def json(self): - if self.is_suspended: + if self.is_banned: return {'username': self.username, 'original_username': self.original_username, 'url': self.url, @@ -1138,12 +1138,6 @@ class User(Base): self.ban_reason = reason - - @property - @lazy - def is_suspended(self): - return (self.is_banned and (not self.unban_utc or self.unban_utc > time.time())) - @property @lazy def is_permabanned(self): diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index b83a4fa76..9b12407dd 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -982,7 +982,7 @@ forced_hats = { "sharpen": ("Bane Mask", "No one understands..."), "earlylife": ("The Merchant", "SHUT IT DOWN, the goys know!"), "marsify": ("Marsified", "I can't pick my own Marseys, help!"), - "is_suspended": ("Behind Bars", "This user is banned and needs to do better!"), + "is_banned": ("Behind Bars", "This user is banned and needs to do better!"), "chud": ( ("Egg_irl", "This user is getting in touch with xir identity!"), ("Trans Flag", "Just in case you forgot, trans lives matter."), diff --git a/files/routes/awards.py b/files/routes/awards.py index 531dcb7bf..2a9e1456f 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -364,13 +364,13 @@ def award_thing(v, thing_type, id): if not emoji: abort(404, f'an Emoji with the name "{award.note}" was not found!') elif kind == "ban": - if not author.is_suspended: + if not author.is_banned: author.ban(reason=ban_reason, days=quantity) elif author.unban_utc: author.unban_utc += 86400 * quantity send_repeatable_notification(author.id, f"Your account has been banned for **{quantity} day{s}** for {obj.textlink}. It sucked and you should feel bad.") elif kind == "unban": - if not author.is_suspended or not author.unban_utc: + if not author.is_banned or not author.unban_utc: abort(403) if not author.ban_reason.startswith('Ban award'): diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 071e05c4d..d8dbf5712 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -162,7 +162,7 @@ def is_not_banned(f): v = get_logged_in_user() if not v: abort(401, "You need to login to perform this action!") - if v.is_suspended: + if v.is_banned: abort(403, "You can't perform this action while banned!") return make_response(f(*args, v=v, **kwargs)) wrapper.__name__ = f.__name__ diff --git a/files/templates/comments.html b/files/templates/comments.html index ded8f0cdb..5d6a433f1 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -504,7 +504,7 @@ {% if v.admin_level >= PERMS['USER_BAN'] and v.id != c.author_id %} - + {% endif %} {% if v.admin_level >= PERMS['USER_CHUD'] and v.id != c.author_id %} @@ -736,7 +736,7 @@ {% if v.id != c.author_id and v.admin_level >= PERMS['USER_BAN'] %} - + {% endif %} {% if v.id != c.author_id and v.admin_level >= PERMS['USER_CHUD'] %} diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index a531a5bb0..4894fd962 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -113,7 +113,7 @@ {% if v.admin_level >= PERMS['USER_BAN'] and v.id != p.author_id %} - + {% endif %} {% if v.admin_level >= PERMS['USER_CHUD'] and v.id != p.author_id %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index 2fba6c5de..950babce0 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -61,7 +61,7 @@ {% if v.id != p.author_id and v.admin_level >= PERMS['USER_BAN'] %} - + {% endif %} {% if v.id != p.author_id and v.admin_level >= PERMS['USER_CHUD'] %} diff --git a/files/templates/userpage/admintools.html b/files/templates/userpage/admintools.html index e4ff0a02b..12229a4bb 100644 --- a/files/templates/userpage/admintools.html +++ b/files/templates/userpage/admintools.html @@ -4,7 +4,7 @@ (by {{u.chudder | safe}}) - {{u.unchud_string}} {% endif %} - {% if u.is_suspended %} + {% if u.is_banned %}
BANNED USER: {{u.ban_reason | safe}} @@ -60,7 +60,7 @@ - + {% endif %} {% if v.admin_level >= PERMS['USER_SHADOWBAN'] %}