aboutsummaryrefslogtreecommitdiff
path: root/app/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/models.py')
-rw-r--r--app/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models.py b/app/models.py
index e8b66fb..aa67c6a 100644
--- a/app/models.py
+++ b/app/models.py
@@ -83,7 +83,8 @@ class Permission(enum.Enum):
if self == Permission.APPROVE_NEW or \
self == Permission.APPROVE_CHANGES or \
- self == Permission.APPROVE_RELEASE:
+ self == Permission.APPROVE_RELEASE or \
+ self == Permission.APPROVE_SCREENSHOT:
return user.rank.atLeast(UserRank.EDITOR)
else:
raise Exception("Non-global permission checked globally. Use Package.checkPerm or User.checkPerm instead.")
@@ -353,7 +354,7 @@ class Package(db.Model):
author=self.author.username, name=self.name)
def getMainScreenshotURL(self):
- screenshot = self.screenshots.first()
+ screenshot = self.screenshots.filter_by(approved=True).first()
return screenshot.url if screenshot is not None else None
def getDownloadRelease(self):