mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-20 19:56:31 +00:00
Add error checking for thumbnail file migration
This commit is contained in:
InvenTree
@@ -30,6 +30,11 @@ class PartConfig(AppConfig):
|
||||
|
||||
if not os.path.exists(loc):
|
||||
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
|
||||
part.image.render_variations(replace=False)
|
||||
try:
|
||||
part.image.render_variations(replace=False)
|
||||
except FileNotFoundError:
|
||||
print("Image file missing")
|
||||
part.image = None
|
||||
part.save()
|
||||
except (OperationalError, ProgrammingError):
|
||||
print("Could not generate Part thumbnails")
|
||||
|
Reference in New Issue
Block a user