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."
if file:
if not os.path.exists('uploads'):
os.makedirs('uploads')
if not os.path.exists('uploads/' + name):
os.makedirs('uploads/' + name)
if not os.path.isdir('/var/www/{id}'.format(id=site['id'])):
os.mkdir('/var/www/{id}'.format(id=site['id']))
filename = file.filename