From e0d19ca72ab329bd26812775c8b196b621cc4112 Mon Sep 17 00:00:00 2001 From: Antonio Golfari Date: Wed, 6 Mar 2024 15:41:59 +0100 Subject: [PATCH] let admin delete any competition --- airscore/user/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airscore/user/views.py b/airscore/user/views.py index 81b3742e..0cf40c3f 100644 --- a/airscore/user/views.py +++ b/airscore/user/views.py @@ -841,7 +841,7 @@ def _get_admin_comps(): def _delete_comp(compid: int): from comp import delete_comp owner, _, _ = frontendUtils.get_comp_scorekeepers(compid) - if current_user.id == owner['id']: + if current_user.is_admin or current_user.id == owner['id']: delete_comp(compid) else: flash(f"You are not the owner of this competition. You cannot delete it.", category='danger')