We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10e49a5 commit 8f0e2dbCopy full SHA for 8f0e2db
app/main/forms.py
@@ -1305,7 +1305,7 @@ class CreateServiceForm(StripWhitespaceForm):
1305
class CreateNhsServiceForm(CreateServiceForm):
1306
organisation_type = OrganisationTypeField(
1307
"Who runs this service?",
1308
- include_only={"nhs_central", "nhs_local", "nhs_gp"},
+ include_only={"nhs_central", "nhs_local", "nhs_gp", "private_pharmacy"},
1309
)
1310
1311
app/main/views/add_service.py
@@ -70,8 +70,8 @@ def add_service():
70
71
new_service = Service.from_id(service_id)
72
73
- # GPs have a zero message limit (to prevent them sending messages while in trial mode)
74
- if form.organisation_type.data == Organisation.TYPE_NHS_GP:
+ # GPs and private pharmacies have a zero message limit (to prevent them sending messages while in trial mode)
+ if form.organisation_type.data in Organisation.ZERO_TEXT_LIMIT_ORGANISATION_TYPES:
75
new_service.update(sms_message_limit=0)
76
77
# show the tour if the user doesn't have any other services. Never show for NHS GPs
app/main/views/agreement.py
@@ -25,6 +25,7 @@ def service_agreement(service_id):
25
if current_service.organisation.agreement_signed:
26
return render_template("views/agreement/service-agreement-signed.html")
27
return render_template("views/agreement/service-agreement.html")
28
+ # TODO: private pharmacies agrrement not implemented yet, so we don't show the agreement page for them.
29
30
31
@main.route("/services/<uuid:service_id>/agreement.pdf")
app/main/views/organisations/index.py
@@ -79,7 +79,9 @@ def add_organisation():
79
@main.route("/services/<uuid:service_id>/add-gp-organisation", methods=["GET", "POST"])
80
@user_has_permissions("manage_service")
81
def add_organisation_from_gp_service(service_id):
82
- if (not current_service.organisation_type == Organisation.TYPE_NHS_GP) or current_service.organisation:
+ if (
83
+ current_service.organisation_type not in Organisation.ZERO_TEXT_LIMIT_ORGANISATION_TYPES
84
+ ) or current_service.organisation:
85
abort(403)
86
87
form = AddGPOrganisationForm(service_name=current_service.name)
app/models/organisation.py
@@ -21,6 +21,7 @@ class Organisation(JSONModel):
21
TYPE_NHS_CENTRAL = "nhs_central"
22
TYPE_NHS_LOCAL = "nhs_local"
23
TYPE_NHS_GP = "nhs_gp"
24
+ TYPE_PRIVATE_PHARMACY = "private_pharmacy"
TYPE_EMERGENCY_SERVICE = "emergency_service"
TYPE_SCHOOL_OR_COLLEGE = "school_or_college"
TYPE_OTHER = "other"
@@ -29,6 +30,7 @@ class Organisation(JSONModel):
TYPE_NHS_CENTRAL,
TYPE_NHS_LOCAL,
32
TYPE_NHS_GP,
33
+ TYPE_PRIVATE_PHARMACY,
34
35
36
TYPE_LABELS = {
@@ -39,9 +41,15 @@ class Organisation(JSONModel):
39
41
TYPE_NHS_GP: "GP surgery",
40
42
TYPE_EMERGENCY_SERVICE: "Emergency service",
43
TYPE_SCHOOL_OR_COLLEGE: "School or college",
44
+ TYPE_PRIVATE_PHARMACY: "Private pharmacy",
45
TYPE_OTHER: "Other",
46
}
47
48
+ ZERO_TEXT_LIMIT_ORGANISATION_TYPES = (
49
+ TYPE_NHS_GP,
50
51
+ )
52
+
53
id: Any
54
name: str
55
active: bool
tests/app/main/views/organisations/test_organisations.py
@@ -85,6 +85,7 @@ def test_page_to_create_new_organisation(
("radio", "organisation_type", "nhs_gp"),
("radio", "organisation_type", "emergency_service"),
("radio", "organisation_type", "school_or_college"),
88
+ ("radio", "organisation_type", "private_pharmacy"),
89
("radio", "organisation_type", "other"),
90
("radio", "crown_status", "crown"),
91
("radio", "crown_status", "non-crown"),
@@ -1345,6 +1346,7 @@ def test_archive_organisation_does_not_allow_orgs_with_team_members_or_services_
1345
1346
{"value": "nhs_gp", "label": "GP surgery"},
1347
{"value": "emergency_service", "label": "Emergency service"},
1348
{"value": "school_or_college", "label": "School or college"},
1349
+ {"value": "private_pharmacy", "label": "Private pharmacy"},
1350
{"value": "other", "label": "Other"},
1351
),
1352
"central",
tests/app/main/views/test_add_service.py
@@ -48,6 +48,7 @@ def test_get_should_render_add_service_template(
"GP surgery",
"Emergency service",
"School or college",
+ "Private pharmacy",
"Other",
]
assert [radio["value"] for radio in page.select(".govuk-radios__item input")] == [
@@ -58,6 +59,7 @@ def test_get_should_render_add_service_template(
58
59
"nhs_gp",
60
"emergency_service",
61
"school_or_college",
62
+ "private_pharmacy",
63
"other",
64
65
@@ -224,12 +226,7 @@ def test_add_service_has_to_choose_org_type(
224
226
225
227
@pytest.mark.parametrize(
228
"email_address",
- (
- "test@nhs.net",
229
- "test@nhs.uk",
230
- "test@example.NhS.uK",
231
- "test@EXAMPLE.NHS.NET",
232
- ),
+ ("test@nhs.net", "test@nhs.uk", "test@example.NhS.uK", "test@EXAMPLE.NHS.NET"),
233
234
def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
235
client_request,
@@ -250,11 +247,13 @@ def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
250
247
"NHS – central government agency or public body",
251
248
"NHS Trust or Integrated Care Board",
252
249
253
254
255
"nhs_central",
256
"nhs_local",
257
258
259
260
@@ -268,6 +267,7 @@ def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
268
267
269
270
271
272
],
273
0 commit comments