changeset 21:e66fd84439bd

Create the tmp dir if not present.
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 01 Oct 2014 09:43:56 +0200
parents 94bc7fe98b85
children dbfe89e3c6fe
files farol/main.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/farol/main.py	Wed Oct 01 09:40:11 2014 +0200
+++ b/farol/main.py	Wed Oct 01 09:43:56 2014 +0200
@@ -159,6 +159,8 @@
             return redirect(url_for('new'))
         fpath = os.path.join(app.instance_path, 'tmp',
                              secure_filename(upload.filename))
+        if not os.path.exists(os.path.dirname(fpath)):
+            os.makedirs(os.path.dirname(fpath))
         upload.save(fpath)
         with open(fpath, 'rt') as f:
             set_text(f.read())

http://farol.wald.intevation.org