diff --git a/app/models/packages.py b/app/models/packages.py index 67e84e0d..8c0e917a 100644 --- a/app/models/packages.py +++ b/app/models/packages.py @@ -736,7 +736,8 @@ class Package(db.Model): needsScreenshot = \ (self.type == self.type.GAME or self.type == self.type.TXP) and \ self.screenshots.count() == 0 - return self.releases.count() > 0 and not needsScreenshot + + return self.releases.filter(PackageRelease.task_id.is_(None)).count() > 0 and not needsScreenshot elif state == PackageState.CHANGES_NEEDED: return self.checkPerm(user, Permission.APPROVE_NEW) diff --git a/app/templates/macros/package_approval.html b/app/templates/macros/package_approval.html index 5fa3d424..84785909 100644 --- a/app/templates/macros/package_approval.html +++ b/app/templates/macros/package_approval.html @@ -14,19 +14,24 @@ {% set level = "warning" %} -{% if package.releases.count() == 0 %} +{% if package.releases.filter_by(task_id=None).count() == 0 %} {% set message %} {% if package.checkPerm(current_user, "MAKE_RELEASE") %} {% if package.update_config %} - - {{ _("Create first release") }} + + {{ _("Create release") }} {% else %} - + {{ _("Set up releases") }} {% endif %} - {{ _("You need to create a release before this package can be approved.") }} + + {% if package.releases.count() == 0 %} + {{ _("You need to create a release before this package can be approved.") }} + {% else %} + {{ _("Release is still importing, or has an error.") }} + {% endif %} {% else %} {{ _("A release is required before this package can be approved.") }} {% endif %}