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