From 9dba3240c36c168f1d2bab74fc84c56158b19c9d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 21 Aug 2022 18:02:01 +0200 Subject: [PATCH] disallow adding ppl as mods to house holes if they're not members of that house --- files/routes/subs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/subs.py b/files/routes/subs.py index a7f5e4a6d..cfc088504 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -241,6 +241,9 @@ def add_mod(v, sub): user = get_user(user) + if sub in ('furry','vampire','racist','femboy') and not (user.house and user.house.lower().startswith(sub)): + return {"error": f"@{user.username} needs to be a member of House {sub.capitalize()} to be added as a mod there!"} + existing = g.db.query(Mod).filter_by(user_id=user.id, sub=sub).one_or_none() if not existing: