forked from rDrama/rDrama
Update admin.py
parent
9b80392c91
commit
b4e4a911f7
|
@ -22,12 +22,6 @@ from files.helpers.discord import add_role
|
||||||
|
|
||||||
IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
|
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")
|
@app.post("/@<username>/make_admin")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def make_admin(v, username):
|
def make_admin(v, username):
|
||||||
|
@ -672,7 +666,7 @@ def verify(user_id, v):
|
||||||
@app.post("/admin/unverify/<user_id>")
|
@app.post("/admin/unverify/<user_id>")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def verify(user_id, v):
|
def unverify(user_id, v):
|
||||||
user = g.db.query(User).filter_by(id=user_id).first()
|
user = g.db.query(User).filter_by(id=user_id).first()
|
||||||
user.verified = False
|
user.verified = False
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
@ -1217,4 +1211,4 @@ def multiple_plots(**kwargs):
|
||||||
plt.savefig("image.png")
|
plt.savefig("image.png")
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
return upload_imgur(png=True)
|
return upload_imgur(png=True)
|
||||||
|
|
Loading…
Reference in New Issue