diff --git a/Options.py b/Options.py index 7f833d5aff57..39fd56765615 100644 --- a/Options.py +++ b/Options.py @@ -746,6 +746,7 @@ def from_text(cls, text: str) -> Range: class FreezeValidKeys(AssembleOptions): def __new__(mcs, name, bases, attrs): + assert not "_valid_keys" in attrs, "'_valid_keys' gets set by FreezeValidKeys, define 'valid_keys' instead." if "valid_keys" in attrs: attrs["_valid_keys"] = frozenset(attrs["valid_keys"]) return super(FreezeValidKeys, mcs).__new__(mcs, name, bases, attrs) diff --git a/WebHostLib/options.py b/WebHostLib/options.py index f52f0f3d9f91..94f173df70cb 100644 --- a/WebHostLib/options.py +++ b/WebHostLib/options.py @@ -79,10 +79,6 @@ def test_ordered(obj): @cache.cached() def option_presets(game: str) -> Response: world = AutoWorldRegister.world_types[game] - presets = {} - - if world.web.options_presets: - presets = presets | world.web.options_presets class SetEncoder(json.JSONEncoder): def default(self, obj): @@ -91,7 +87,7 @@ def default(self, obj): return list(obj) return json.JSONEncoder.default(self, obj) - json_data = json.dumps(presets, cls=SetEncoder) + json_data = json.dumps(world.web.options_presets, cls=SetEncoder) response = Response(json_data) response.headers["Content-Type"] = "application/json" return response diff --git a/WebHostLib/templates/playerOptions/macros.html b/WebHostLib/templates/playerOptions/macros.html index 64964682fe5f..c4d97255d85e 100644 --- a/WebHostLib/templates/playerOptions/macros.html +++ b/WebHostLib/templates/playerOptions/macros.html @@ -114,7 +114,7 @@ {% macro ItemDict(option_name, option, world) %} {{ OptionTitle(option_name, option) }}