forked from rDrama/rDrama
fdfd
parent
f700c9c3c8
commit
19e9fe8f31
|
@ -949,16 +949,15 @@ def admin_banned_domains(v):
|
||||||
banned_domains = g.db.query(BannedDomain).all()
|
banned_domains = g.db.query(BannedDomain).all()
|
||||||
return render_template("admin/banned_domains.html", v=v, banned_domains=banned_domains)
|
return render_template("admin/banned_domains.html", v=v, banned_domains=banned_domains)
|
||||||
|
|
||||||
@app.post("/admin/ban_domain")
|
@app.post("/admin/toggle_ban_domain")
|
||||||
@admin_level_required(4)
|
@admin_level_required(4)
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def admin_ban_domain(v):
|
def admin_toggle_ban_domain(v):
|
||||||
|
|
||||||
domain=request.form.get("domain").strip()
|
domain=request.form.get("domain").strip()
|
||||||
if not domain: abort(400)
|
if not domain: abort(400)
|
||||||
|
|
||||||
reason=request.form.get("reason", "").strip()
|
reason=request.form.get("reason", "").strip()
|
||||||
if not reason: abort(400)
|
|
||||||
|
|
||||||
d = g.db.query(BannedDomain).filter_by(domain=domain.replace("_","\_")).first()
|
d = g.db.query(BannedDomain).filter_by(domain=domain.replace("_","\_")).first()
|
||||||
if d: g.db.delete(d)
|
if d: g.db.delete(d)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<form action="/admin/ban_domain" method="post">
|
<form action="/admin/toggle_ban_domain" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input name="domain" placeholder="Enter domain here.." class="form-control" required>
|
<input name="domain" placeholder="Enter domain here.." class="form-control" required>
|
||||||
<input name="reason" placeholder="Enter ban reason here.." class="form-control">
|
<input name="reason" placeholder="Enter ban reason here.." class="form-control">
|
||||||
|
|
Loading…
Reference in New Issue