def validate_delegation_conditions(self):
        """If our domain is delegated then an A record can only have a
        name that is the same as a nameserver in that domain (glue)."""
        if not (self.domain and self.domain.delegated):
            return
        if self.domain.nameserver_set.filter(server=self.fqdn).exists():
            return
        else:
            # Confusing error messege?
            raise ValidationError(
                "You can only create A records in a "
                "delegated domain that have an NS record pointing to them.")
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/mozdns/address_record/models.py/BaseAddressRecord.validate_delegation_conditions/original