Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 1573-Fix Saving Feature #1574

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions game/static/game/js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions game/views/level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down