@django_dispatch.receiver(
    django_signals.pre_delete, sender=compatibility_models.ChannelCompatibility
)
def compatibility_deleted(sender, instance, **kwargs):

    if compatibility_models.ChannelCompatibility.objects.exclude(
        pk=instance.pk
    ).filter(
        groundstation=instance.groundstation,
        spacecraft=instance.spacecraft
    ).count() == 0:

        operational_models.OperationalSlot.objects.filter(
            pass_slot=pass_models.PassSlots.objects.filter(
                groundstation=instance.groundstation,
                spacecraft=instance.spacecraft
            )
        ).delete()


# noinspection PyUnusedLocal
Updates the available Operational Slots after an existing compatibility
dataset/ETHPy150Open satnet-project/server/services/scheduling/signals/operational.py/compatibility_deleted