mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Add service versioning to broadcast account type change
We are using the `set_broadcast_service_type` route to make changes to service objects. However, we had forgotten to add the `version_class` decorator to it which will mean the changing of a service going from training to live mode will also be recorded in the services_history table for free. Whilst not essential, this easy change makes things more consistent for how we update other services.
This commit is contained in:
@@ -3,11 +3,19 @@ from datetime import datetime
|
||||
from flask import current_app
|
||||
|
||||
from app import db
|
||||
from app.models import ServiceBroadcastSettings, ServicePermission, Organisation, BROADCAST_TYPE, EMAIL_AUTH_TYPE
|
||||
from app.dao.dao_utils import transactional
|
||||
from app.dao.dao_utils import transactional, version_class
|
||||
from app.models import (
|
||||
Service,
|
||||
ServiceBroadcastSettings,
|
||||
ServicePermission,
|
||||
Organisation,
|
||||
BROADCAST_TYPE,
|
||||
EMAIL_AUTH_TYPE
|
||||
)
|
||||
|
||||
|
||||
@transactional
|
||||
@version_class(Service)
|
||||
def set_broadcast_service_type(service, service_mode, broadcast_channel, provider_restriction):
|
||||
insert_or_update_service_broadcast_settings(
|
||||
service, channel=broadcast_channel, provider_restriction=provider_restriction
|
||||
|
||||
Reference in New Issue
Block a user