mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Catch error if notes directory does not exist (#4638)
This commit is contained in:
		| @@ -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') | ||||
|  | ||||
|     try: | ||||
|         images = os.listdir(notes_dir) | ||||
|     except FileNotFoundError: | ||||
|         # Thrown if the directory does not exist | ||||
|         images = [] | ||||
|  | ||||
|     all_notes = NotesImage.objects.all() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user