From d9cc95dd712f4611db203b382ebab8c12fe4947b Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 6 Oct 2022 20:06:22 -0700 Subject: [PATCH] fix global hole mod and template error --- files/classes/user.py | 2 +- files/routes/subs.py | 4 ++-- files/templates/userpage.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 0792c8159..a3e1c09f8 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -285,7 +285,7 @@ class User(Base): @lazy def mods(self, sub): if self.is_suspended_permanently or self.shadowbanned: return False - return self.admin_level >= PERMS['GLOBAL_MODERATION'] or bool(g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none()) + return self.admin_level >= PERMS['HOLE_GLOBAL_MODERATION'] or bool(g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none()) @lazy def exiled_from(self, sub): diff --git a/files/routes/subs.py b/files/routes/subs.py index 5c7187454..06396a571 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -366,7 +366,7 @@ def kick(v, pid): old = post.sub post.sub = None - if v.admin_level >= PERMS['GLOBAL_MODERATION'] and v.id != post.author_id: + if v.admin_level >= PERMS['HOLE_GLOBAL_MODERATION'] and v.id != post.author_id: old_str = f'/h/{old}' ma = ModAction( kind='move_hole', @@ -385,7 +385,7 @@ def kick(v, pid): g.db.add(ma) if v.id != post.author_id: - if v.admin_level >= PERMS['GLOBAL_MODERATION']: position = 'Admin' + if v.admin_level >= PERMS['HOLE_GLOBAL_MODERATION']: position = 'Admin' else: position = 'Mod' message = f"@{v.username} ({position}) has moved [{post.title}]({post.shortlink}) from /h/{old} to the main feed!" send_repeatable_notification(post.author_id, message) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 8c6895ae1..f0a15abaf 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -349,7 +349,7 @@ Disable Chud Theme {% endif %}

-						{% if v and v.admin_level >= PERMS['USER_BAN']}
+						{% if v and v.admin_level >= PERMS['USER_BAN'] %}
 							Mute
 							Unmute
 						{% endif %}