mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 19:57:29 +01:00
parent
31a748b0b3
commit
65e8929689
@ -667,15 +667,18 @@ def game_support(package):
|
|||||||
detect_update_needed = False
|
detect_update_needed = False
|
||||||
|
|
||||||
if current_user not in package.maintainers:
|
if current_user not in package.maintainers:
|
||||||
resolver = GameSupportResolver(db.session)
|
try:
|
||||||
|
resolver = GameSupportResolver(db.session)
|
||||||
|
|
||||||
game_is_supported = {}
|
game_is_supported = {}
|
||||||
for game in get_games_from_csv(db.session, form.supported.data or ""):
|
for game in get_games_from_csv(db.session, form.supported.data or ""):
|
||||||
game_is_supported[game.id] = True
|
game_is_supported[game.id] = True
|
||||||
for game in get_games_from_csv(db.session, form.unsupported.data or ""):
|
for game in get_games_from_csv(db.session, form.unsupported.data or ""):
|
||||||
game_is_supported[game.id] = False
|
game_is_supported[game.id] = False
|
||||||
resolver.set_supported(package, game_is_supported, 11)
|
resolver.set_supported(package, game_is_supported, 11)
|
||||||
detect_update_needed = True
|
detect_update_needed = True
|
||||||
|
except LogicError as e:
|
||||||
|
flash(e.message, "danger")
|
||||||
|
|
||||||
next_url = package.getURL("packages.game_support")
|
next_url = package.getURL("packages.game_support")
|
||||||
|
|
||||||
|
@ -146,18 +146,21 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
|||||||
|
|
||||||
# Update game support
|
# Update game support
|
||||||
if package.type == PackageType.MOD:
|
if package.type == PackageType.MOD:
|
||||||
resolver = GameSupportResolver(db.session)
|
try:
|
||||||
|
resolver = GameSupportResolver(db.session)
|
||||||
|
|
||||||
game_is_supported = {}
|
game_is_supported = {}
|
||||||
if "supported_games" in tree.meta:
|
if "supported_games" in tree.meta:
|
||||||
for game in get_games_from_csv(db.session, tree.meta["supported_games"]):
|
for game in get_games_from_csv(db.session, tree.meta["supported_games"]):
|
||||||
game_is_supported[game.id] = True
|
game_is_supported[game.id] = True
|
||||||
if "unsupported_games" in tree.meta:
|
if "unsupported_games" in tree.meta:
|
||||||
for game in get_games_from_csv(db.session, tree.meta["unsupported_games"]):
|
for game in get_games_from_csv(db.session, tree.meta["unsupported_games"]):
|
||||||
game_is_supported[game.id] = False
|
game_is_supported[game.id] = False
|
||||||
|
|
||||||
resolver.set_supported(package, game_is_supported, 10)
|
resolver.set_supported(package, game_is_supported, 10)
|
||||||
resolver.update(package)
|
resolver.update(package)
|
||||||
|
except LogicError as e:
|
||||||
|
raise TaskError(e.message)
|
||||||
|
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user