fds
This commit is contained in:
parent
1af5877d28
commit
0287890bfc
2 changed files with 13 additions and 8 deletions
|
@ -846,9 +846,10 @@ def admin_title_change(user_id, v):
|
||||||
note=f'"{new_name}"'
|
note=f'"{new_name}"'
|
||||||
)
|
)
|
||||||
g.db.add(ma)
|
g.db.add(ma)
|
||||||
|
|
||||||
g.db.commit()
|
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/<user_id>")
|
@app.post("/ban_user/<user_id>")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
|
@ -918,11 +919,11 @@ def ban_user(user_id, v):
|
||||||
comment = get_comment(comment)
|
comment = get_comment(comment)
|
||||||
comment.bannedfor = True
|
comment.bannedfor = True
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": f"@{user.username} was banned!"}
|
|
||||||
else:
|
if 'redir' in request.values: return (redirect(user.url), user)
|
||||||
g.db.commit()
|
else: return {"message": f"@{user.username} was banned!"}
|
||||||
return redirect(user.url)
|
|
||||||
|
|
||||||
|
|
||||||
@app.post("/unban_user/<user_id>")
|
@app.post("/unban_user/<user_id>")
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
{% if u.is_suspended %}
|
{% if u.is_suspended %}
|
||||||
<form action="/unban_user/{{u.id}}/" method="post" action="">
|
<form action="/unban_user/{{u.id}}/" method="post" action="">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
<input type="hidden" name="redir" value="true">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" id="alts-1-desktop" class="custom-control-input" name="alts" value="1">
|
<input type="checkbox" id="alts-1-desktop" class="custom-control-input" name="alts" value="1">
|
||||||
<label class="custom-control-label" for="alts-1-desktop">Include alts</label>
|
<label class="custom-control-label" for="alts-1-desktop">Include alts</label>
|
||||||
|
@ -298,6 +299,7 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<form action="/ban_user/{{u.id}}" method="post" action="">
|
<form action="/ban_user/{{u.id}}" method="post" action="">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
<input type="hidden" name="redir" value="true">
|
||||||
<input style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit').disabled=false">
|
<input style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit').disabled=false">
|
||||||
<input style="font-size:11px;" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
<input style="font-size:11px;" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
|
@ -562,7 +564,8 @@
|
||||||
{% if u.is_suspended %}
|
{% if u.is_suspended %}
|
||||||
<form action="/unban_user/{{u.id}}" method="post">
|
<form action="/unban_user/{{u.id}}" method="post">
|
||||||
<input type="hidden" name="formkey", value="{{v.formkey}}">
|
<input type="hidden" name="formkey", value="{{v.formkey}}">
|
||||||
<br />
|
<input type="hidden" name="redir" value="true">
|
||||||
|
<br/>
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" id="alts-1-mobile" class="custom-control-input" name="alts" value="1">
|
<input type="checkbox" id="alts-1-mobile" class="custom-control-input" name="alts" value="1">
|
||||||
<label class="custom-control-label" for="alts-1-mobile">Include alts</label>
|
<label class="custom-control-label" for="alts-1-mobile">Include alts</label>
|
||||||
|
@ -573,6 +576,7 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<form action="/ban_user/{{u.id}}/" method="post">
|
<form 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 style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit2').disabled=false">
|
<input style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit2').disabled=false">
|
||||||
<input style="font-size:11px;" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
<input style="font-size:11px;" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue