def check_for_delegation(self):
        """
        If an object's domain is delegated it should not be able to
        be changed.  Delegated domains cannot have objects created in
        them.
        """
        try:
            if not self.domain.delegated:
                return
        except __HOLE__:
            return
        if not self.pk:  # We don't exist yet.
            raise ValidationError("No objects can be created in the {0}"
                                  "domain. It is delegated."
                                  .format(self.domain.name))
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/mozdns/models.py/MozdnsRecord.check_for_delegation