make it impossible to leave !jannies

pull/136/head
Aevann 2023-02-28 22:07:31 +02:00
parent 24c298f329
commit 76156ba9c4
1 changed files with 3 additions and 0 deletions

View File

@ -76,6 +76,9 @@ def join_group(v:User, group_name):
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@auth_required
def leave_group(v:User, group_name):
if group_name == 'jannies':
abort(403, "You can't leave !jannies")
group = g.db.get(Group, group_name)
if not group: abort(404)
existing = g.db.query(GroupMembership).filter_by(user_id=v.id, group_name=group_name).one_or_none()