

def delete(self, *args, **kwargs):
    '\n        Address Records that are glue records or that are pointed to\n        by a CNAME should not be removed from the database.\n        '
    if kwargs.pop('validate_glue', True):
        if self.nameserver_set.exists():
            raise ValidationError('Cannot delete the record {0}. It is a glue record.'.format(args.record_type()))
    if kwargs.pop('check_cname', True):
        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/VarMisuse@48/134 `self`->`args`