Fix unapproved games showing in supported games

Fixes #429
This commit is contained in:
rubenwardy 2023-05-13 16:10:53 +01:00
parent 0658368aad
commit e168da4f72

@ -523,7 +523,7 @@ class Package(db.Model):
def getSortedSupportedGames(self, include_unsupported=False): def getSortedSupportedGames(self, include_unsupported=False):
query = self.supported_games query = self.supported_games
if not include_unsupported: if not include_unsupported:
query = query.filter_by(supports=True) query = query.filter(PackageGameSupport.game.has(state=PackageState.APPROVED)).filter_by(supports=True)
supported = query.all() supported = query.all()
supported.sort(key=lambda x: -(x.game.score + 100000*x.confidence)) supported.sort(key=lambda x: -(x.game.score + 100000*x.confidence))