mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Change logic to check whether a user folder is empty or not
This commit is contained in:
parent
477e583be9
commit
ca25ea0b80
@ -25,7 +25,7 @@ def upgrade():
|
||||
if os.path.exists(spacy_nlp_pipeline_models_dir):
|
||||
if not os.path.isdir(spacy_nlp_pipeline_models_dir):
|
||||
raise OSError(f'Not a directory: {spacy_nlp_pipeline_models_dir}')
|
||||
if not os.listdir(spacy_nlp_pipeline_models_dir):
|
||||
if len(os.listdir(spacy_nlp_pipeline_models_dir)) > 0:
|
||||
raise OSError(f'Directory not empty: {spacy_nlp_pipeline_models_dir}')
|
||||
else:
|
||||
os.mkdir(spacy_nlp_pipeline_models_dir)
|
||||
|
@ -24,7 +24,7 @@ def upgrade():
|
||||
if os.path.exists(users_dir):
|
||||
if not os.path.isdir(users_dir):
|
||||
raise OSError(f'Not a directory: {users_dir}')
|
||||
if not os.listdir(users_dir):
|
||||
if len(os.listdir(users_dir)) > 0:
|
||||
raise OSError(f'Directory not empty: {users_dir}')
|
||||
else:
|
||||
os.mkdir(users_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user