Make service created by platform admin non-counted

If a service has been created by someone on our team, it’s probably a
test service, which shouldn’t be included in the count of live services.
This commit is contained in:
Chris Hill-Scott
2019-03-25 13:27:41 +00:00
parent b3008ee210
commit eb41ce7304
2 changed files with 13 additions and 1 deletions

View File

@@ -179,6 +179,7 @@ def dao_create_service(
service.active = True
service.research_mode = False
service.crown = service.organisation_type == 'central'
service.count_as_live = not user.platform_admin
for permission in service_permissions:
service_permission = ServicePermission(service_id=service.id, permission=permission)