Exemple #1
0
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)
Exemple #2
0
def delete_images_for_organisation(sender, instance, **kwargs):
    services.delete_images([instance.image, instance.logo])
Exemple #3
0
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])
Exemple #4
0
def delete_images_for_Idea(sender, instance, **kwargs):
    services.delete_images([instance.image])
Exemple #5
0
def delete_images_for_User(sender, instance, **kwargs):
    services.delete_images([instance.avatar])