Fix game support errors not showing to users

Fixes #394
This commit is contained in:
rubenwardy 2023-01-02 19:19:33 +00:00
parent 31a748b0b3
commit 65e8929689
2 changed files with 24 additions and 18 deletions

@ -667,6 +667,7 @@ def game_support(package):
detect_update_needed = False
if current_user not in package.maintainers:
try:
resolver = GameSupportResolver(db.session)
game_is_supported = {}
@ -676,6 +677,8 @@ def game_support(package):
game_is_supported[game.id] = False
resolver.set_supported(package, game_is_supported, 11)
detect_update_needed = True
except LogicError as e:
flash(e.message, "danger")
next_url = package.getURL("packages.game_support")

@ -146,6 +146,7 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
# Update game support
if package.type == PackageType.MOD:
try:
resolver = GameSupportResolver(db.session)
game_is_supported = {}
@ -158,6 +159,8 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
resolver.set_supported(package, game_is_supported, 10)
resolver.update(package)
except LogicError as e:
raise TaskError(e.message)
return tree