def delete_old_image(sender, instance, **kwargs): old_images = [] if hasattr(instance, '_current_image_file'): if instance._current_image_file != instance.image: old_images.append(instance._current_image_file) if hasattr(instance, '_current_logo_file'): if instance._current_logo_file != instance.logo: old_images.append(instance._current_logo_file) services.delete_images(old_images)
def delete_images_for_organisation(sender, instance, **kwargs): services.delete_images([instance.image, instance.logo])
def delete_old_image(sender, instance, **kwargs): if hasattr(instance, '_current_image_file'): if instance._current_image_file != instance.image: services.delete_images([instance._current_image_file])
def delete_images_for_Idea(sender, instance, **kwargs): services.delete_images([instance.image])
def delete_images_for_User(sender, instance, **kwargs): services.delete_images([instance.avatar])