forked from MarseyWorld/MarseyWorld
make "unban user" button in userpage work instantly
parent
5ef2b41d5e
commit
ab9c0288fb
|
@ -1062,8 +1062,7 @@ def unban_user(user_id, v):
|
||||||
)
|
)
|
||||||
g.db.add(ma)
|
g.db.add(ma)
|
||||||
|
|
||||||
if "@" in request.referrer: return redirect(user.url)
|
return {"message": f"@{user.username} has been unbanned!"}
|
||||||
else: return {"message": f"@{user.username} has been unbanned!"}
|
|
||||||
|
|
||||||
@app.post("/mute_user/<int:user_id>/<int:mute_status>")
|
@app.post("/mute_user/<int:user_id>/<int:mute_status>")
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
|
|
|
@ -42,14 +42,9 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v.admin_level >= PERMS['USER_BAN'] %}
|
{% if v.admin_level >= PERMS['USER_BAN'] %}
|
||||||
{% if u.is_suspended %}
|
<button type="button" id="unban-{{deviceType}}" class="mt-1 mb-3 {% if not u.is_suspended %}d-none{% endif %} btn btn-success" onclick="postToastSwitch(this,'/unban_user/{{u.id}}','ban-{{deviceType}}','unban-{{deviceType}}','d-none')">Unban user</button>
|
||||||
<form class="mb-2" action="/unban_user/{{u.id}}" method="post">
|
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<form id="ban-{{deviceType}}" class="mb-3 {% if u.is_suspended %}d-none{% endif %}" action="/ban_user/{{u.id}}" method="post">
|
||||||
<input type="hidden" name="redir" value="true">
|
|
||||||
<input type="submit" onclick="disable(this)" class="btn btn-success" value="Unban user">
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<form class="mb-2" action="/ban_user/{{u.id}}" method="post">
|
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input type="hidden" name="redir" value="true">
|
<input type="hidden" name="redir" value="true">
|
||||||
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" oninput="document.getElementById('user-ban-submit-{{deviceType}}').disabled=false" required>
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" oninput="document.getElementById('user-ban-submit-{{deviceType}}').disabled=false" required>
|
||||||
|
@ -61,7 +56,6 @@
|
||||||
<input autocomplete="off" id="user-ban-submit-{{deviceType}}" type="submit" onclick="disable(this)" class="btn btn-danger" value="Ban user" disabled>
|
<input autocomplete="off" id="user-ban-submit-{{deviceType}}" type="submit" onclick="disable(this)" class="btn btn-danger" value="Ban user" disabled>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% if v.admin_level >= PERMS['USER_SHADOWBAN'] %}
|
{% if v.admin_level >= PERMS['USER_SHADOWBAN'] %}
|
||||||
{% if u.shadowbanned %}
|
{% if u.shadowbanned %}
|
||||||
<form class="mb-2" action="/unshadowban/{{u.id}}" method="post">
|
<form class="mb-2" action="/unshadowban/{{u.id}}" method="post">
|
||||||
|
|
Loading…
Reference in New Issue