From 0f0c40951bb37e43c746f43bd79255b5a3fd2eec Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Thu, 5 Sep 2019 12:00:31 +0200
Subject: [PATCH] Use fix path!

---
 .env_example          | 1 -
 app/services/views.py | 4 ++--
 config.py             | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/.env_example b/.env_example
index e74e5b7d..f328a3ed 100644
--- a/.env_example
+++ b/.env_example
@@ -12,7 +12,6 @@ MAIL_DEFAULT_SENDER=username@example.com
 
 ### Opaque ###
 OPAQUE_ADMIN=admin.opaque@example.com
-OPAQUE_STORAGE_DIRECTORY=/absolut/path/to/opaque/storage/directory
 
 ### Flask-SQLAlchemy ###
 # SQLALCHEMY_DATABASE_URI=
diff --git a/app/services/views.py b/app/services/views.py
index 96247d57..52c36084 100644
--- a/app/services/views.py
+++ b/app/services/views.py
@@ -26,7 +26,7 @@ def nlp():
         db.session.add(nlp_job)
         db.session.commit()
 
-        dir = os.path.join(current_app.config['OPAQUE_STORAGE'],
+        dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
                            str(nlp_job.user_id),
                            'jobs',
                            str(nlp_job.id))
@@ -72,7 +72,7 @@ def ocr():
         db.session.add(ocr_job)
         db.session.commit()
 
-        dir = os.path.join(current_app.config['OPAQUE_STORAGE'],
+        dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
                            str(ocr_job.user_id),
                            'jobs',
                            str(ocr_job.id))
diff --git a/config.py b/config.py
index 836cdcfe..fd0e246c 100644
--- a/config.py
+++ b/config.py
@@ -18,7 +18,7 @@ class Config:
 
     ''' ### Opaque ### '''
     OPAQUE_ADMIN = os.environ.get('OPAQUE_ADMIN')
-    OPAQUE_STORAGE_DIRECTORY = os.environ.get('OPAQUE_STORAGE_DIRECTORY')
+    OPAQUE_STORAGE_DIRECTORY = '/opaque_storage'
 
     @staticmethod
     def init_app(app):
-- 
GitLab