Delete service cache when changing an organisation's sector

When we change an organisation's sector we now also change the sector of
all its services, so we need to delete those services from Redis.
This commit is contained in:
Katie Smith
2019-07-24 11:57:42 +01:00
parent eb7504bc0d
commit dc1c73c647
4 changed files with 99 additions and 5 deletions

View File

@@ -216,8 +216,11 @@ def edit_organisation_type(org_id):
)
if form.validate_on_submit():
org_service_ids = [service['id'] for service in current_organisation.services]
organisations_client.update_organisation(
current_organisation.id,
cached_service_ids=org_service_ids,
organisation_type=form.organisation_type.data,
)
return redirect(url_for('.organisation_settings', org_id=org_id))