def pre_save_picture(sender, **kwargs): instance = kwargs['instance'] if instance.pk: old_instance = Picture.objects.get(pk=instance.pk) if old_instance.image and old_instance.image != instance.image: delete_image(old_instance.image)
def post_delete_picture(sender, **kwargs): instance = kwargs['instance'] if instance.image: delete_image(instance.image)