fix: Create dir on upload

This commit is contained in:
Nathan Woodburn 2024-02-23 15:00:41 +11:00
parent e322b8bbe7
commit 084a161e80
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -120,10 +120,8 @@ def upload_site(name):
return "Error: No file provided." return "Error: No file provided."
if file: if file:
if not os.path.exists('uploads'): if not os.path.isdir('/var/www/{id}'.format(id=site['id'])):
os.makedirs('uploads') os.mkdir('/var/www/{id}'.format(id=site['id']))
if not os.path.exists('uploads/' + name):
os.makedirs('uploads/' + name)
filename = file.filename filename = file.filename