From 5093fdf61e7cf17212a068d1e87f31d4e440c61c Mon Sep 17 00:00:00 2001
From: Sarra <sarra.ouelhadj@gmail.com>
Date: Fri, 26 Aug 2022 13:35:08 +0200
Subject: [PATCH] Heroku fixings

---
 Procfile       | 3 +--
 YKWIM/views.py | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Procfile b/Procfile
index 27bfa37..2b40544 100644
--- a/Procfile
+++ b/Procfile
@@ -1,2 +1 @@
-web: gunicorn YKWIM:app
-init: FLASK_APP=run.py
\ No newline at end of file
+web: gunicorn YKWIM:app
\ No newline at end of file
diff --git a/YKWIM/views.py b/YKWIM/views.py
index 689fa5d..854d0c0 100644
--- a/YKWIM/views.py
+++ b/YKWIM/views.py
@@ -9,7 +9,7 @@ def index():
         datasetURL=request.form["datasetURL"]
         file = request.files["templateFile"]
         file.save(os.path.join(app.config['UPLOAD_FOLDER'],secure_filename(file.filename)))
-        uml_image = pl.plantUML2Image(app.config['UPLOAD_FOLDER']+secure_filename(file.filename), "svg")
+        uml_image = pl.plantUML2Image(app.config['UPLOAD_FOLDER']+secure_filename(file.filename))
         return render_template("index.html", uml_image=url_for('getDocumentLink',document_link=uml_image))
     else:            
         return render_template("index.html")
@@ -17,5 +17,5 @@ def index():
 
 @app.route("/<document_link>")
 def getDocumentLink(document_link):
-    return redirect("/tmp/"+document_link)
+    return send_from_directory(app.config['UPLOAD_FOLDER'],document_link)
     #send_from_directory(app.config['UPLOAD_FOLDER'],document_link)
-- 
GitLab