From 309009d3a414ac55c392e7748db6408f84322958 Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Mon, 14 Oct 2019 21:24:41 +0200 Subject: [PATCH] Other fixes --- CHANGELOG.md | 1 + app.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e33d07..9d64fc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added flask-login dependency. Now, user logins can be persistent up to 365 days. * Rewritten `enrich` filter, correcting a serious security flaw. The new filter uses a tokenizer and escapes all non-markup text. Plus, now the `+` of the mention is visible, but weakened; newlines are now visible in the message. * Now you can edit or change privacy to messages after they are published. After a message it's edited, the date and time of the message is changed. +* Fixed a bug when uploading. ## 0.4.0 diff --git a/app.py b/app.py index 4b910d9..be1068e 100644 --- a/app.py +++ b/app.py @@ -149,6 +149,10 @@ class Relationship(BaseModel): UPLOAD_DIRECTORY = 'uploads/' + +# fixing directory name because of imports from other directory +if __name__ != '__main__': + UPLOAD_DIRECTORY = os.path.join(os.path.dirname(__file__), UPLOAD_DIRECTORY) class Upload(BaseModel): # the extension of the media type = TextField()