diff --git a/CHANGELOG.md b/CHANGELOG.md index c34fa49b9..33d90eedb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ +## v5.16.12 (2024-01-23) + +### Fix + +* 1573-Fix Saving Feature ([#1574](https://github.com/ocadotechnology/rapid-router/issues/1574)) ([`f95f2e2`](https://github.com/ocadotechnology/rapid-router/commit/f95f2e2f4edc5937f00fdeda32a72935b942cae0)) + ## v5.16.11 (2024-01-22) ### Fix diff --git a/game/__init__.py b/game/__init__.py index 7c703fa8d..c691c3bed 100644 --- a/game/__init__.py +++ b/game/__init__.py @@ -1 +1 @@ -__version__ = "5.16.11" +__version__ = "5.16.12" diff --git a/game/static/game/js/game.js b/game/static/game/js/game.js index 1d12d4205..3ef18a762 100644 --- a/game/static/game/js/game.js +++ b/game/static/game/js/game.js @@ -1211,13 +1211,13 @@ ocargo.Game.prototype._setupSaveTab = function () { break } } - var workspace = { name: newName, contents: ocargo.blocklyControl.serialize(), python_contents: ocargo.pythonControl.getCode(), blockly_enabled: BLOCKLY_ENABLED, - python_enabled: PYTHON_ENABLED + python_enabled: PYTHON_ENABLED, + pythonViewEnabled: PYTHON_VIEW_ENABLED } this.saving.saveWorkspace( diff --git a/game/views/level.py b/game/views/level.py index 865edc7b2..a4511b002 100644 --- a/game/views/level.py +++ b/game/views/level.py @@ -360,6 +360,10 @@ def load_workspace(request, workspaceID): def save_workspace(request, workspaceID=None): + request_params = ["name", "contents", "python_contents", "blockly_enabled", "python_enabled", "pythonViewEnabled"] + missing_params = [param for param in request_params if param not in request.POST] + if missing_params != []: + raise Exception("Request missing the following required parameters", missing_params) name = request.POST.get("name") contents = request.POST.get("contents") python_contents = request.POST.get("python_contents")