Improve logging

This commit is contained in:
Gabriel Augendre 2023-03-24 11:15:47 +01:00
parent 5055603927
commit 2d4db98b6b

View file

@ -102,6 +102,7 @@ class Attachment(models.Model):
res = response.json()
if len(res) == 0 or not isinstance(res, list):
logger.error("Shortpixel response is not a non-empty list: %s", res)
logger.info("POST data: %s", data)
return super().save(*args, **kwargs)
res_data = res[0]