Do only allow machinecode files for selection/printing

This commit is contained in:
Gina Häußge 2015-07-06 10:49:13 +02:00
parent 08546f5730
commit 3441431cdf
2 changed files with 8 additions and 0 deletions

View file

@ -10,6 +10,11 @@
Will now log the update commands and their output similar to the Plugin
Manager install and uninstall dialog.
### Bug Fixes
* It's not possible anymore to select files that are not machinecode files (e.g.
GCODE) for printing on the file API.
## 1.2.2 (2015-06-30)
### Bug Fixes

View file

@ -292,6 +292,9 @@ def gcodeFileCommand(filename, target):
if command == "select":
# selects/loads a file
if not octoprint.filemanager.valid_file_type(filename, type="machinecode"):
return make_response("Cannot select {filename} for printing, not a machinecode file".format(**locals()), 415)
printAfterLoading = False
if "print" in data.keys() and data["print"] in valid_boolean_trues:
if not printer.is_operational():