Removed obsolete elif branch in file upload code
This commit is contained in:
parent
aed9e905f2
commit
9b010db0b8
2 changed files with 0 additions and 17 deletions
|
|
@ -68,21 +68,6 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
|
|||
self._logger.exception("Error while converting the imported profile")
|
||||
return flask.make_response("Something went wrong while converting imported profile: {message}".format(str(e)), 500)
|
||||
|
||||
elif input_name in flask.request.files:
|
||||
temp_file = tempfile.NamedTemporaryFile("wb", delete=False)
|
||||
try:
|
||||
temp_file.close()
|
||||
upload = flask.request.files[input_name]
|
||||
upload.save(temp_file.name)
|
||||
profile_dict = Profile.from_cura_ini(temp_file.name)
|
||||
except Exception as e:
|
||||
self._logger.exception("Error while converting the imported profile")
|
||||
return flask.make_response("Something went wrong while converting imported profile: {message}".format(str(e)), 500)
|
||||
finally:
|
||||
os.remove(temp_file)
|
||||
|
||||
filename = upload.filename
|
||||
|
||||
else:
|
||||
self._logger.warn("No profile file included for importing, aborting")
|
||||
return flask.make_response("No file included", 400)
|
||||
|
|
|
|||
|
|
@ -135,8 +135,6 @@ def uploadGcodeFile(target):
|
|||
input_upload_path = input_name + "." + settings().get(["server", "uploads", "pathSuffix"])
|
||||
if input_upload_name in request.values and input_upload_path in request.values:
|
||||
upload = octoprint.filemanager.util.DiskFileWrapper(request.values[input_upload_name], request.values[input_upload_path])
|
||||
elif input_name in request.files:
|
||||
upload = WerkzeugFileWrapper(request.files[input_name])
|
||||
else:
|
||||
return make_response("No file included", 400)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue