- Migration to add Service.organisation_id

- Add oranisation_id to Service data model.
- Update methods to create service and associate service to organisation to set the organisation_id on the Service.
- Create the missing test, if the service user email matches a domain for an organisation then associate the service to the organisation and inherit crown and organisation_type from the organisation.
This commit is contained in:
Rebecca Law
2019-08-12 15:59:27 +01:00
parent 6ea849298e
commit 12f305bf86
5 changed files with 46 additions and 12 deletions

View File

@@ -100,6 +100,7 @@ def dao_add_service_to_organisation(service, organisation_id):
).one()
organisation.services.append(service)
service.organisation_id = organisation_id
service.organisation_type = organisation.organisation_type
service.crown = organisation.crown