def hydrate(self, bundle):
        # Nameservers don't have a label
        if 'fqdn' in bundle.data:
            bundle.errors['domain'] = "Nameservers shouldn't have a fqdn"
        elif 'label' in bundle.data:
            bundle.errors['domain'] = "Nameservers shouldn't have a label"
        else:
            domain_name = bundle.data.get('domain', '')
            try:
                domain = Domain.objects.get(name=domain_name)
                bundle.data['domain'] = domain
            except __HOLE__:
                error = "Couldn't find domain {0}".format(domain_name)
                bundle.errors['domain'] = error
        return bundle
dataset/ETHPy150Open mozilla/inventory/mozdns/api/v1/api.py/NameserverResource.hydrate