Update service with the user that requested to go live.

When a service is marked as live update the service with the go live datetime.
This commit is contained in:
Rebecca Law
2019-04-16 15:01:54 +01:00
parent d3cb5aa796
commit da8eead475
4 changed files with 18 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
from datetime import datetime
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
@@ -87,6 +88,8 @@ class ServiceAPIClient(NotifyAdminAPIClient):
'volume_letter',
'consent_to_research',
'count_as_live',
'go_live_user',
'go_live_at'
}
if disallowed_attributes:
raise TypeError('Not allowed to update service attributes: {}'.format(
@@ -102,6 +105,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
service_id,
message_limit=250000 if live else 50,
restricted=(not live),
go_live_at=str(datetime.utcnow()) if live else None
)
# This method is not cached because it calls through to one which is