diff --git a/app/domains.yml b/app/domains.yml index 96d1c4ad9..66d3695e0 100644 --- a/app/domains.yml +++ b/app/domains.yml @@ -223,7 +223,7 @@ acas.org.uk: owner: Advisory, Conciliation and Arbitration Service crown: true agreement_signed: false -charitycommission.gsi.gov.uk: +charitycommission.gsi.gov.uk: charitycommission.gov.uk charitycommission.gov.uk: owner: Charity Commission crown: true @@ -257,7 +257,7 @@ hse.gov.uk: owner: Health and Safety Executive crown: true agreement_signed: false -hmtreasury.gsi.gov.uk: +hmtreasury.gsi.gov.uk: hmtreasury.gov.uk hmtreasury.gov.uk: owner: HM Treasury crown: true @@ -5122,7 +5122,7 @@ wyrebc.gov.uk: owner: Wyre Borough Council crown: false agreement_signed: false -wyreforestdc.gov.uk: +wyreforestdc.gov.uk: wyreforest.gov.uk wyreforest.gov.uk: owner: Wyre Forest District Council crown: false diff --git a/app/utils.py b/app/utils.py index dc3713743..5aef6e833 100644 --- a/app/utils.py +++ b/app/utils.py @@ -563,10 +563,10 @@ class AgreementInfo: def _get_info(self): - details = self.domains.get(self._match) + details = self.domains.get(self._match, {}) - if isinstance(details, None): - raise TypeError('Domain must have details ({})'.format(self._match)) + if details is None: + raise TypeError('Domain must have details ({})'.format(self._domain)) if isinstance(details, str): self.is_canonical = False diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index 7bdfd4ebf..c6849cf9c 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -403,11 +403,7 @@ def test_validate_government_domain_data(): True, False, None } - assert ( - agreement_info.owner is None - ) or ( - isinstance(agreement_info.owner, str) - ) + assert isinstance(agreement_info.owner, str) and agreement_info.owner.strip() assert agreement_info.agreement_signed in { True, False, None