fdd7edc23c6974c82867f4c583899c727c441b76,app/grandchallenge/archives/models.py,Archive,delete,#Archive#,22

Before Change


                    protected_patient_ids.add(image.study.patient.id)
                    break

        related_patients = Patient.objects.filter(
            study__image__in=images_to_remove
        ).distinct()
        related_studies = Study.objects.filter(
            image__in=images_to_remove
        ).distinct()
        for patient in related_patients:
            if patient.id not in protected_patient_ids:
                patient.delete(*args, **kwargs)
        for study in related_studies:
            if study.id not in protected_study_ids:
                study.delete(*args, **kwargs)

After Change


            images_to_remove
        )

        Patient.objects.filter(
            study__image__in=images_to_remove
        ).distinct().exclude(pk__in=protected_patient_ids).delete(
            *args, **kwargs
        )
        Study.objects.filter(image__in=images_to_remove).distinct().exclude(
            pk__in=protected_study_ids
        ).delete(*args, **kwargs)
        images_to_remove.delete(*args, **kwargs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: comic/grand-challenge.org
Commit Name: fdd7edc23c6974c82867f4c583899c727c441b76
Time: 2019-09-03
Author: harm.van.zeeland@gmail.com
File Name: app/grandchallenge/archives/models.py
Class Name: Archive
Method Name: delete


Project Name: samuelclay/NewsBlur
Commit Name: 904f0385f6fdd1db85fe4f704c67ef92eb884b0b
Time: 2011-11-01
Author: samuel@ofbrooklyn.com
File Name: apps/statistics/models.py
Class Name: MStatistics
Method Name: collect_statistics_feeds_fetched


Project Name: comic/grand-challenge.org
Commit Name: fdd7edc23c6974c82867f4c583899c727c441b76
Time: 2019-09-03
Author: harm.van.zeeland@gmail.com
File Name: app/grandchallenge/archives/models.py
Class Name: Archive
Method Name: delete


Project Name: matthewwithanm/django-imagekit
Commit Name: 4c78f2d24c4125b6df42a9f4a8a7fdede3f46bcd
Time: 2011-09-09
Author: matthew@exanimo.com
File Name: imagekit/models.py
Class Name: ImageModel
Method Name: save_image