Commit b07dbf63dba5219f92786335f51e865e06677dfc
1 parent
043c081b
Exists in
master
and in
1 other branch
Creating submissions_dir directory when it des not exist.
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
src/web/server.py
@@ -78,8 +78,11 @@ class Package: | @@ -78,8 +78,11 @@ class Package: | ||
78 | 78 | ||
79 | class Request: | 79 | class Request: |
80 | def __init__(self,web_input): | 80 | def __init__(self,web_input): |
81 | - outputdir = tempfile.mkdtemp(prefix='',dir='./submissions/') | ||
82 | - user_id = outputdir.lstrip('./submissions/') | 81 | + submissions_dir = "./submissions/" |
82 | + if not os.path.exists(submissions_dir): | ||
83 | + os.makedirs(submissions_dir) | ||
84 | + outputdir = tempfile.mkdtemp(prefix='',dir=submissions_dir) | ||
85 | + user_id = outputdir.lstrip(submissions_dir) | ||
83 | self.user_id = user_id | 86 | self.user_id = user_id |
84 | self.storage = web_input | 87 | self.storage = web_input |
85 | 88 |