From a33a4bd894a686f8d3f60ecaae618562606ea442 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 28 Apr 2021 23:18:16 +0100 Subject: [PATCH] Fix editors not being able to approve releases --- app/models/packages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/packages.py b/app/models/packages.py index 9807e59..5462af7 100644 --- a/app/models/packages.py +++ b/app/models/packages.py @@ -913,8 +913,9 @@ class PackageRelease(db.Model): return count > 0 elif perm == Permission.APPROVE_RELEASE: - return isMaintainer and user.rank.atLeast( - UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER) + return user.rank.atLeast(UserRank.EDITOR) or \ + (isMaintainer and user.rank.atLeast( + UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER)) else: raise Exception("Permission {} is not related to releases".format(perm.name))