2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Merge pull request #2730 from SchrodingersGat/warning-messages

Change error messages to warnings when rebuilding thumbnails
This commit is contained in:
Oliver 2022-03-09 15:24:21 +11:00 committed by GitHub
commit fe12b889d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,14 +43,12 @@ class Command(BaseCommand):
try: try:
model.image.render_variations(replace=False) model.image.render_variations(replace=False)
except FileNotFoundError: except FileNotFoundError:
logger.error(f"ERROR: Image file '{img}' is missing") logger.warning(f"Warning: Image file '{img}' is missing")
except UnidentifiedImageError: except UnidentifiedImageError:
logger.error(f"ERROR: Image file '{img}' is not a valid image") logger.warning(f"Warning: Image file '{img}' is not a valid image")
def handle(self, *args, **kwargs): def handle(self, *args, **kwargs):
logger.setLevel(logging.INFO)
logger.info("Rebuilding Part thumbnails") logger.info("Rebuilding Part thumbnails")
for part in Part.objects.exclude(image=None): for part in Part.objects.exclude(image=None):