Fix minor security vulnerability

This commit is contained in:
rubenwardy 2020-05-19 16:46:47 +01:00
parent ffb5b49521
commit 8484c0f0aa

@ -847,12 +847,11 @@ class PackageRelease(db.Model):
name=self.package.name, name=self.package.name,
id=self.id) id=self.id)
def __init__(self): def __init__(self):
self.releaseDate = datetime.datetime.now() self.releaseDate = datetime.datetime.now()
def approve(self, user): def approve(self, user):
if self.package.approved and \ if self.package.approved or \
not self.package.checkPerm(user, Permission.APPROVE_RELEASE): not self.package.checkPerm(user, Permission.APPROVE_RELEASE):
return False return False