mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 19:01:17 +00:00
Add error checking for thumbnail file migration
This commit is contained in:
1 parent
d6d891c16f
commit
37fcb810e4
3 files changed
+20
-3
No files matched your search
@@ -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")
|
||||
Reference in new issue
Block a user