Refactor to avoid redefinition of org types

We’re defining the list of org types in a few different places. This
makes it more likely we’ll forget to update one of these places, thereby
introducing a bug.

This commit moves the definition to be on the organisation model, which
feels like a sensible enough place for it.
This commit is contained in:
Chris Hill-Scott
2019-08-27 15:52:42 +01:00
parent 0466d57565
commit efabf0e87d
2 changed files with 35 additions and 30 deletions

View File

@@ -7,6 +7,17 @@ from app.notify_client.organisations_api_client import organisations_client
class Organisation(JSONModel):
TYPES = (
('central', 'Central government'),
('local', 'Local government'),
('nhs_central', 'NHS central government agency or public body'),
('nhs_local', 'NHS Trust or Clinical Commissioning Group'),
('nhs_local', 'GP practice'),
('emergency_service', 'Emergency service'),
('school_or_college', 'School or college'),
('other', 'Other'),
)
ALLOWED_PROPERTIES = {
'id',
'name',