mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Catch error if notes directory does not exist (#4638)
This commit is contained in:
parent
1b8ad70fb6
commit
eafd2ac966
@ -118,7 +118,11 @@ def delete_old_notes_images():
|
||||
# Finally, remove any images in the notes dir which are not linked to a note
|
||||
notes_dir = os.path.join(settings.MEDIA_ROOT, 'notes')
|
||||
|
||||
images = os.listdir(notes_dir)
|
||||
try:
|
||||
images = os.listdir(notes_dir)
|
||||
except FileNotFoundError:
|
||||
# Thrown if the directory does not exist
|
||||
images = []
|
||||
|
||||
all_notes = NotesImage.objects.all()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user