forked from rDrama/rDrama
Merge pull request #34 from justcool393/master
Admintools/Verification: allow admins to verify usersmaster
commit
6d746d9437
|
@ -22,12 +22,6 @@ from files.helpers.discord import add_role
|
|||
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
|
||||
|
||||
@app.get("/imgurcredits")
|
||||
@admin_level_required(6)
|
||||
def imgurcredits(v):
|
||||
req = requests.get('https://api.imgur.com/3/credits', headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}).json()
|
||||
return req
|
||||
|
||||
@app.post("/@<username>/make_admin")
|
||||
@admin_level_required(6)
|
||||
def make_admin(v, username):
|
||||
|
@ -660,6 +654,24 @@ def unshadowban(user_id, v):
|
|||
|
||||
return "", 204
|
||||
|
||||
@app.post("/admin/verify/<user_id>")
|
||||
@admin_level_required(6)
|
||||
@validate_formkey
|
||||
def verify(user_id, v):
|
||||
user = g.db.query(User).filter_by(id=user_id).first()
|
||||
user.verified = True
|
||||
g.db.add(user)
|
||||
return "", 204
|
||||
|
||||
@app.post("/admin/unverify/<user_id>")
|
||||
@admin_level_required(6)
|
||||
@validate_formkey
|
||||
def unverify(user_id, v):
|
||||
user = g.db.query(User).filter_by(id=user_id).first()
|
||||
user.verified = False
|
||||
g.db.add(user)
|
||||
return "", 204
|
||||
|
||||
|
||||
@app.post("/admin/title_change/<user_id>")
|
||||
@admin_level_required(6)
|
||||
|
@ -1199,4 +1211,4 @@ def multiple_plots(**kwargs):
|
|||
plt.savefig("image.png")
|
||||
plt.clf()
|
||||
|
||||
return upload_imgur(png=True)
|
||||
return upload_imgur(png=True)
|
||||
|
|
|
@ -308,6 +308,14 @@
|
|||
<a class="btn btn-danger" href="javascript:void(0)" onclick="post_toast('/shadowban/{{u.id}}')">Shadowban</a>
|
||||
{% endif %}
|
||||
|
||||
<pre></pre>
|
||||
|
||||
{% if u.verified %}
|
||||
<a class="btn btn-danger" href="javasript:void(0)" onclick="post_toast('/admin/unverify/{{u.id}}')">Unverify</a>
|
||||
{% else %}
|
||||
<a class="btn btn-success" href="javasript:void(0)" onclick="post_toast('/admin/verify/{{u.id}}')">Verify</a>
|
||||
{% endif %}
|
||||
|
||||
<pre></pre>
|
||||
<form action="/admin/unnuke_user" method="post">
|
||||
<input type="hidden" name="formkey", value="{{v.formkey}}">
|
||||
|
|
Loading…
Reference in New Issue