Fix editors not being able to approve releases

This commit is contained in:
rubenwardy 2021-04-28 23:18:16 +01:00
parent c0719fdeaa
commit a33a4bd894
1 changed files with 3 additions and 2 deletions

View File

@ -913,8 +913,9 @@ class PackageRelease(db.Model):
return count > 0 return count > 0
elif perm == Permission.APPROVE_RELEASE: elif perm == Permission.APPROVE_RELEASE:
return isMaintainer and user.rank.atLeast( return user.rank.atLeast(UserRank.EDITOR) or \
UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER) (isMaintainer and user.rank.atLeast(
UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER))
else: else:
raise Exception("Permission {} is not related to releases".format(perm.name)) raise Exception("Permission {} is not related to releases".format(perm.name))