mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Make set_as_broadcast_service use a single DB commit
We don't want things in a half state if there is an error during the method. Therefore, we move it all into a single function that is wrapped in a transaction. Note, we copy the approach of https://github.com/alphagov/notifications-api/blob/master/app/dao/services_dao.py#L293 by having a single new dao function that does all the DB work.
This commit is contained in:
@@ -16,7 +16,7 @@ from app.dao.jobs_dao import dao_create_job
|
||||
from app.dao.notifications_dao import dao_create_notification
|
||||
from app.dao.organisation_dao import dao_create_organisation, dao_add_service_to_organisation
|
||||
from app.dao.services_dao import (dao_create_service, dao_add_user_to_service)
|
||||
from app.dao.service_broadcast_settings_dao import insert_or_update_service_broadcast_settings
|
||||
from app.dao.broadcast_service_dao import insert_or_update_service_broadcast_settings
|
||||
from app.dao.templates_dao import dao_create_template
|
||||
from app.dao.users_dao import create_secret_code, create_user_code
|
||||
from app.history_meta import create_history
|
||||
|
||||
Reference in New Issue
Block a user