Use update_fields when saving preview images

This commit is contained in:
Mouse Reeve 2021-08-03 11:47:52 -07:00
parent 19acfeeb72
commit 2b6423792c

View file

@ -338,9 +338,9 @@ def save_and_cleanup(image, instance=None):
save_without_broadcast = isinstance(instance, (models.Book, models.User)) save_without_broadcast = isinstance(instance, (models.Book, models.User))
if save_without_broadcast: if save_without_broadcast:
instance.save(broadcast=False) instance.save(broadcast=False, update_fields=["preview_image"])
else: else:
instance.save() instance.save(update_fields=["preview_image"])
# Clean up old file after saving # Clean up old file after saving
if old_path and default_storage.exists(old_path): if old_path and default_storage.exists(old_path):