mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Slim down the /organisations response
At the moment this response returns a list of service IDs for hundreds of organisations. The admin app doesn’t use this information, but having to wait for it to be serialized and sent across the network slows it down all the same.
This commit is contained in:
@@ -620,15 +620,18 @@ def create_domain(domain, organisation_id):
|
||||
return domain
|
||||
|
||||
|
||||
def create_organisation(name='test_org_1', active=True, organisation_type=None):
|
||||
def create_organisation(name='test_org_1', active=True, organisation_type=None, domains=None):
|
||||
data = {
|
||||
'name': name,
|
||||
'active': active,
|
||||
'organisation_type': organisation_type
|
||||
'organisation_type': organisation_type,
|
||||
}
|
||||
organisation = Organisation(**data)
|
||||
dao_create_organisation(organisation)
|
||||
|
||||
for domain in domains or []:
|
||||
create_domain(domain, organisation.id)
|
||||
|
||||
return organisation
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user