fix global hole mod and template error

master
justcool393 2022-10-06 20:06:22 -07:00
parent 182784f097
commit d9cc95dd71
3 changed files with 4 additions and 4 deletions

View File

@ -285,7 +285,7 @@ class User(Base):
@lazy @lazy
def mods(self, sub): def mods(self, sub):
if self.is_suspended_permanently or self.shadowbanned: return False 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 @lazy
def exiled_from(self, sub): def exiled_from(self, sub):

View File

@ -366,7 +366,7 @@ def kick(v, pid):
old = post.sub old = post.sub
post.sub = None 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'<a href="/h/{old}">/h/{old}</a>' old_str = f'<a href="/h/{old}">/h/{old}</a>'
ma = ModAction( ma = ModAction(
kind='move_hole', kind='move_hole',
@ -385,7 +385,7 @@ def kick(v, pid):
g.db.add(ma) g.db.add(ma)
if v.id != post.author_id: 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' else: position = 'Mod'
message = f"@{v.username} ({position}) has moved [{post.title}]({post.shortlink}) from /h/{old} to the main feed!" 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) send_repeatable_notification(post.author_id, message)

View File

@ -349,7 +349,7 @@
<a id="unagendaposter" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/unagendaposter/{{u.id}}','agendaposter1','unagendaposter','d-none')">Disable Chud Theme</a> <a id="unagendaposter" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/unagendaposter/{{u.id}}','agendaposter1','unagendaposter','d-none')">Disable Chud Theme</a>
{% endif %} {% endif %}
<pre></pre> <pre></pre>
{% if v and v.admin_level >= PERMS['USER_BAN']} {% if v and v.admin_level >= PERMS['USER_BAN'] %}
<a id="mute-user" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/1','mute-user','unmute-user','d-none')">Mute</a> <a id="mute-user" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/1','mute-user','unmute-user','d-none')">Mute</a>
<a id="unmute-user" class="{% if not u.is_muted %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/0','mute-user','unmute-user','d-none')">Unmute</a> <a id="unmute-user" class="{% if not u.is_muted %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/0','mute-user','unmute-user','d-none')">Unmute</a>
{% endif %} {% endif %}