diff --git a/files/routes/admin.py b/files/routes/admin.py index 51cf56da1..74dd0425f 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1030,14 +1030,6 @@ def ban_user(fullname, v): reason = reason_regex_post.sub(r'\1', reason) reason = reason_regex_comment.sub(r'\1', reason) - user.ban(admin=v, reason=reason, days=days) - - if request.values.get("alts"): - for x in get_alt_graph(user.id): - if x.admin_level > v.admin_level: - continue - x.ban(admin=v, reason=reason, days=days) - duration = "permanently" if days: days_txt = str(days) @@ -1050,8 +1042,17 @@ def ban_user(fullname, v): if reason: text = f"@{v.username} (a site admin) has banned you permanently for the following reason:\n\n> {reason}" else: text = f"@{v.username} (a site admin) has banned you permanently." + + user.ban(admin=v, reason=reason, days=days) send_repeatable_notification(user.id, text) + if request.values.get("alts"): + for x in get_alt_graph(user.id): + if x.admin_level > v.admin_level: + continue + x.ban(admin=v, reason=reason, days=days) + send_repeatable_notification(x.id, text) + note = f'duration: {duration}, reason: "{reason}"' ma = ModAction( kind="ban_user",