Fix crash on manual game support override

This commit is contained in:
rubenwardy 2024-03-27 19:16:29 +00:00
parent 2c0d90e797
commit 434fd03fe8

@ -343,7 +343,11 @@ def game_support_set(session, package: Package, game_is_supported: Dict[int, boo
game = session.query(Package).get(game_id)
lookup = previous_supported.pop(game_id, None)
if lookup is None:
support = PackageGameSupport(package, game, confidence, supports)
support = PackageGameSupport()
support.package = package
support.game = game
support.confidence = confidence
support.supports = supports
session.add(support)
elif lookup.confidence <= confidence:
lookup.supports = supports