From 5c158891aab5e1e9546158af687ae86dd49ec34c Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 4 Jun 2021 11:32:56 +0100 Subject: [PATCH] Prune the email domains list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We only need domains in here which either: - don’t belong to a single organisation (eg gov.uk) All other domains should be stored in the database. This PR removes domains which are now in the database. Before --- ```sql select domain from domain where domain in ('gov.uk', 'mod.uk', 'mil.uk', 'd dc-mod.org', 'gov.scot', 'parliament.scot', 'parliament.uk', 'nhs.uk', 'nhs.net', 'nhs.scot', 'police.uk', 'scotent.c o.uk', 'assembly.wales', 'cjsm.net', 'gov.wales', 'ac.uk', 'sch.uk', 'onevoicewales.wales', 'mtvh.co.uk', 'wmca.org.u k', 'suttonmail.org'); ``` +-----------------+ | domain | |-----------------+ | mtvh.co.uk | | wmca.org.uk | | gov.wales | | gov.scot | | parliament.uk | | assembly.wales | | mil.uk | | mod.uk | | ddc-mod.org | | parliament.scot | | scotent.co.uk | +-----------------+ After --- ```sql select domain from domain where domain in ('gov.uk', 'nhs.uk', 'nhs.ne t', 'nhs.scot', 'police.uk', 'cjsm.net', 'ac.uk', 'sch.uk', 'onevoicewales.wales', 'suttonmail.org') ; ``` +----------+ | domain | |----------| +----------+ --- app/email_domains.txt | 11 ----------- tests/app/main/test_validators.py | 12 +++--------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/email_domains.txt b/app/email_domains.txt index 6abc8f7bf..f259c826c 100644 --- a/app/email_domains.txt +++ b/app/email_domains.txt @@ -1,21 +1,10 @@ gov.uk -mod.uk -mil.uk -ddc-mod.org -gov.scot -parliament.scot -parliament.uk nhs.uk nhs.net nhs.scot police.uk -scotent.co.uk -assembly.wales cjsm.net -gov.wales ac.uk sch.uk onevoicewales.wales -mtvh.co.uk -wmca.org.uk suttonmail.org diff --git a/tests/app/main/test_validators.py b/tests/app/main/test_validators.py index a92cf19d3..5798dd2d4 100644 --- a/tests/app/main/test_validators.py +++ b/tests/app/main/test_validators.py @@ -80,23 +80,17 @@ def _gen_mock_field(x): 'test@gov.uK', 'test@test.test.gov.uk', 'test@test.gov.uk', - 'test@mod.uk', - 'test@ddc-mod.org', - 'test@test.ddc-mod.org', - 'test@gov.scot', - 'test@test.gov.scot', - 'test@parliament.uk', - 'test@gov.parliament.uk', 'test@nhs.uk', 'test@gov.nhs.uk', 'test@nhs.net', 'test@gov.nhs.net', + 'test@nhs.scot', 'test@police.uk', 'test@gov.police.uk', 'test@GOV.PoliCe.uk', - 'test@scotent.co.uk', - 'test@assembly.wales', 'test@cjsm.net', + 'test@example.ac.uk', + 'test@example.sch.uk', ]) def test_valid_list_of_white_list_email_domains( client,