def delete(self, *args, **kwargs):
        """
        Address Records that are glue records or that are pointed to
        by a CNAME should not be removed from the database.
        """
        if kwargs.pop("validate_glue", True):
            if self.nameserver_set.exists():
                raise ValidationError(
                    "Cannot delete the record {0}. It is a glue "
                    "record.".format(self.record_type())
                )
        if kwargs.pop("check_cname", True):
            # If there is a cname pointing at us and there is no other address
            # record that it could be pointing at, fail to be deleted.
            if (CNAME.objects.filter(target=self.fqdn).exists() and
                    not self.__class__.objects.filter(fqdn=self.fqdn)
                    .exclude(pk=self.pk).exists()):
                raise ValidationError(
                    "A CNAME points to this {0} record. Change the CNAME "
                    "before deleting this record.".format(self.record_type())
                )

        super(BaseAddressRecord, self).delete(*args, **kwargs)
dataset/ETHPy150Open mozilla/inventory/mozdns/address_record/models.py/BaseAddressRecord.delete/original