Skip to content

Commit 3ca0fc8

Browse files
committed
prevent bots from banning mods
1 parent 1b81965 commit 3ca0fc8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sogs/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ def ban_user(mod_user, room, ban_user):
658658
)
659659
return False
660660

661+
if mod_user is None and is_mod:
662+
app.logger.warn("bots cannot ban moderators")
663+
return False
664+
661665
conn.execute(
662666
"""
663667
INSERT INTO user_permission_overrides (room, user, banned, moderator, admin)

0 commit comments

Comments
 (0)