From 1d184661e1f08086925ed63b0d9fabcb4db9965e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 17 Sep 2022 20:43:50 +0200 Subject: [PATCH] allow me to remove/approve marseys and hats --- files/routes/asset_submissions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index b85049df6..b4de9f84e 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -94,7 +94,7 @@ def submit_marsey(v): @app.post("/admin/approve/marsey/") @admin_level_required(3) def approve_marsey(v, name): - if CARP_ID and v.id != CARP_ID: + if v.id not in (AEVANN_ID, CARP_ID): return {"error": "Only Carp can approve marseys!"}, 403 name = name.lower().strip() @@ -167,7 +167,7 @@ def remove_marsey(v, name): if not marsey: return {"error": f"This marsey '{name}' doesn't exist!"}, 404 - if v.id not in {marsey.submitter_id, CARP_ID}: + if v.id not in (marsey.submitter_id, AEVANN_ID, CARP_ID): return {"error": "Only Carp can remove marseys!"}, 403 if v.id != marsey.submitter_id: @@ -253,7 +253,7 @@ def submit_hat(v): @app.post("/admin/approve/hat/") @admin_level_required(3) def approve_hat(v, name): - if CARP_ID and v.id != CARP_ID: + if v.id not in (AEVANN_ID, CARP_ID): return {"error": "Only Carp can approve hats!"}, 403 name = name.strip() @@ -329,7 +329,7 @@ def remove_hat(v, name): if not hat: return {"error": f"This hat '{name}' doesn't exist!"}, 404 - if v.id not in {hat.submitter_id, CARP_ID}: + if v.id not in (hat.submitter_id, AEVANN_ID, CARP_ID): return {"error": "Only Carp can remove hats!"}, 403 if v.id != hat.submitter_id: