mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Add go_live_at timestamp to set_as_broadcast_service
Note, I haven't added anything for the `go_live_user` because it doesn't quite make sense because here a user isn't requesting to go live. So there should be no reason to record this. We will in time though want to add audit events to capture every change to the service broadcast settings, that will actually capture who has done what.
This commit is contained in:
@@ -1116,6 +1116,14 @@ def set_as_broadcast_service(service_id):
|
||||
|
||||
service.count_as_live = False
|
||||
|
||||
if data["service_mode"] == "live":
|
||||
if service.restricted == True:
|
||||
# Only update the go live at timestamp if this if moving from training mode
|
||||
# to live mode, not if it's moving from one type of live mode service to another
|
||||
service.go_live_at = datetime.utcnow()
|
||||
else:
|
||||
service.go_live_at = None
|
||||
|
||||
service.restricted = True
|
||||
if data["service_mode"] == "live":
|
||||
service.restricted = False
|
||||
|
||||
Reference in New Issue
Block a user