mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 15:56:45 -04:00
Add organisation_id to Service.
This is the second commit in the series to add organisation_id to Service. - Data migration to update services.organisation_id from data in organisation_to_service (The rollback will lose any updates to organisation unless the script is updated to set organistion_to_service from service.organisation_id ) - Update Service.organisation relationship to a ForeignKey relationship to Organisation. - Update Organisation.services to a backref relationship to Service.
This commit is contained in:
@@ -99,7 +99,6 @@ def dao_add_service_to_organisation(service, organisation_id):
|
||||
id=organisation_id
|
||||
).one()
|
||||
|
||||
organisation.services.append(service)
|
||||
service.organisation_id = organisation_id
|
||||
service.organisation_type = organisation.organisation_type
|
||||
service.crown = organisation.crown
|
||||
|
||||
@@ -293,7 +293,7 @@ def dao_create_service(
|
||||
insert_service_sms_sender(service, current_app.config['FROM_NUMBER'])
|
||||
|
||||
if organisation:
|
||||
service.organisation = organisation
|
||||
# service.organisation = organisation
|
||||
service.organisation_id = organisation.id
|
||||
service.organisation_type = organisation.organisation_type
|
||||
if organisation.email_branding:
|
||||
|
||||
Reference in New Issue
Block a user