Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive mkdir #18

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from functools import wraps
from glob import glob
from mimetypes import guess_type
from os import path, mkdir, remove
from os import path, makedirs, remove
from urllib.parse import quote
from urllib.request import pathname2url
from sh import convert
Expand Down Expand Up @@ -202,7 +202,7 @@ def resolve_file():
return path.join(relpath, scaled_name)

if settings.STORAGE_TYPE != 'digitalocean_spaces' and not path.exists(basepath):
mkdir(basepath)
makedirs(basepath)

orig_dir = path.join(settings.BASE_DIR, get_rel_path(request.query.coll, thumb_p=False))
orig_path = path.join(orig_dir, storename)
Expand Down Expand Up @@ -373,7 +373,7 @@ def fileupload():

elif settings.STORAGE_TYPE == 'local':
if not path.exists(basepath):
mkdir(basepath)
makedirs(basepath)

upload.save(pathname, overwrite=True)

Expand Down