#18 File upload in certain folders
* adds try-except for removing folders in case of non existence or changed folder names on the hard drive
This commit is contained in:
1 parent
1edc1edc98
commit
416d11d1ee
3 files changed
+30
-8
No files matched your search
+10
-2
@@ -252,7 +252,11 @@ class CompensationDocument(AbstractDocument):
|
||||
|
||||
# If a folder path has been set, we need to delete the whole folder!
|
||||
if folder_path is not None:
|
||||
shutil.rmtree(folder_path)
|
||||
try:
|
||||
shutil.rmtree(folder_path)
|
||||
except FileNotFoundError:
|
||||
# Folder seems to be missing already...
|
||||
pass
|
||||
|
||||
|
||||
class EcoAccount(AbstractCompensation):
|
||||
@@ -408,7 +412,11 @@ class EcoAccountDocument(AbstractDocument):
|
||||
|
||||
# If a folder path has been set, we need to delete the whole folder!
|
||||
if folder_path is not None:
|
||||
shutil.rmtree(folder_path)
|
||||
try:
|
||||
shutil.rmtree(folder_path)
|
||||
except FileNotFoundError:
|
||||
# Folder seems to be missing already...
|
||||
pass
|
||||
|
||||
|
||||
class EcoAccountDeduction(BaseResource):
|
||||
|
||||
Reference in new issue
Block a user