2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Add error checking for thumbnail file migration

This commit is contained in:
Oliver Walters
2020-04-17 19:23:43 +10:00
parent d6d891c16f
commit 37fcb810e4
3 changed files with 20 additions and 3 deletions

View File

@ -31,6 +31,11 @@ class CompanyConfig(AppConfig):
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Company '{c}'".format(c=company.name))
company.image.render_variations(replace=False)
try:
company.image.render_variations(replace=False)
except FileNotFoundError:
print("Image file missing")
company.image = None
company.save()
except (OperationalError, ProgrammingError):
print("Could not generate Company thumbnails")