Skip to content

Commit

Permalink
Return newline instead of the empty jupyter script
Browse files Browse the repository at this point in the history
  • Loading branch information
fruttasecca committed Mar 21, 2023
1 parent fa694d4 commit 8022df6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/orchest-webserver/app/app/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,16 @@ def jupyter_setup_script():
return ""

else:
# If it's an empty string the FE will not allow editing,
# perhaps a bug that happened when reworking the settings.
empty_script = "\n"
try:
with open(setup_script_path, "r") as f:
script = f.read()
return jsonify({"script": script if script else ""})
return jsonify({"script": script if script else empty_script})
except FileNotFoundError as fnf_error:
current_app.logger.error(f"Failed to read setup_script {fnf_error}")
return ""
return jsonify({"script": empty_script})

@app.route("/async/pipelines/<project_uuid>/<pipeline_uuid>", methods=["DELETE"])
def pipelines_delete(project_uuid, pipeline_uuid):
Expand Down

0 comments on commit 8022df6

Please sign in to comment.