diff --git a/endpoints/api/organization.py b/endpoints/api/organization.py index db5e1a67f..2979a869c 100644 --- a/endpoints/api/organization.py +++ b/endpoints/api/organization.py @@ -121,7 +121,7 @@ class Organization(ApiResource): 'description': 'Whether the organization desires to receive emails for invoices', }, 'invoice_email_address': { - 'type': 'string', + 'type': ['string', 'null'], 'description': 'The email address at which to receive invoices', }, 'tag_expiration': { diff --git a/endpoints/api/user.py b/endpoints/api/user.py index 913272b94..b4109695f 100644 --- a/endpoints/api/user.py +++ b/endpoints/api/user.py @@ -199,7 +199,7 @@ class User(ApiResource): 'description': 'The user\'s username', }, 'invoice_email_address': { - 'type': 'string', + 'type': ['string', 'null'], 'description': 'Custom email address for receiving invoices', } }, diff --git a/test/test_api_usage.py b/test/test_api_usage.py index 7903fe012..c8c6cf2bc 100644 --- a/test/test_api_usage.py +++ b/test/test_api_usage.py @@ -46,7 +46,7 @@ from endpoints.api.organization import (OrganizationList, OrganizationMember, OrgPrivateRepositories, OrganizationMemberList, Organization, ApplicationInformation, OrganizationApplications, OrganizationApplicationResource, - OrganizationApplicationResetClientSecret) + OrganizationApplicationResetClientSecret, Organization) from endpoints.api.repository import RepositoryList, RepositoryVisibility, Repository from endpoints.api.permission import (RepositoryUserPermission, RepositoryTeamPermission, RepositoryTeamPermissionList, RepositoryUserPermissionList) @@ -2890,6 +2890,13 @@ class TestOrganizationApplicationResource(ApiTestCase): expected_code=404) +class TestOrganization(ApiTestCase): + def test_change_send_billing_invoice(self): + self.login(ADMIN_ACCESS_USER) + self.putJsonResponse(Organization, params=dict(orgname=ORGANIZATION), + data=dict(invoice_email=False, invoice_email_address=None)) + + class TestOrganizationApplicationResetClientSecret(ApiTestCase): def test_reset_client_secret(self): self.login(ADMIN_ACCESS_USER)