diff --git a/files/routes/admin.py b/files/routes/admin.py index 35263ff7a4..b63ad04194 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -846,9 +846,10 @@ def admin_title_change(user_id, v): note=f'"{new_name}"' ) g.db.add(ma) - g.db.commit() - return (redirect(user.url), user) + + if 'redir' in request.values: return (redirect(user.url), user) + else: return {"message": f"@{user.username} was unbanned!"} @app.post("/ban_user/") @admin_level_required(6) @@ -918,11 +919,11 @@ def ban_user(user_id, v): comment = get_comment(comment) comment.bannedfor = True g.db.add(comment) - g.db.commit() - return {"message": f"@{user.username} was banned!"} - else: - g.db.commit() - return redirect(user.url) + + g.db.commit() + + if 'redir' in request.values: return (redirect(user.url), user) + else: return {"message": f"@{user.username} was banned!"} @app.post("/unban_user/") diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 1477124121..a4189fda60 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -289,6 +289,7 @@ {% if u.is_suspended %}
+
@@ -298,6 +299,7 @@ {% else %} +
@@ -562,7 +564,8 @@ {% if u.is_suspended %} -
+ +
@@ -573,6 +576,7 @@ {% else %} +