diff --git a/src/gam/gapi/cloudidentity/userinvitations.py b/src/gam/gapi/cloudidentity/userinvitations.py index 2ca132c6..db121c52 100644 --- a/src/gam/gapi/cloudidentity/userinvitations.py +++ b/src/gam/gapi/cloudidentity/userinvitations.py @@ -12,8 +12,11 @@ from gam.gapi import errors as gapi_errors from gam.gapi import cloudidentity as gapi_cloudidentity def _get_customerid(): - ''' returns customer in format needed for this API''' - return f'customers/{GC_Values[GC_CUSTOMER_ID]}' + ''' returns customer in "customers/(C){customer_id}' format needed for this API''' + customer = GC_Values[GC_CUSTOMER_ID] + if customer != MY_CUSTOMER and customer[0] != 'C': + customer = 'C' + customer + return f'customers/{customer}' def _reduce_name(name): ''' converts long name into email address''' diff --git a/src/gam/gapi/directory/printers.py b/src/gam/gapi/directory/printers.py index 856cbbce..ae887c9c 100644 --- a/src/gam/gapi/directory/printers.py +++ b/src/gam/gapi/directory/printers.py @@ -10,8 +10,10 @@ from gam.gapi.directory import orgunits as gapi_directory_orgunits def _get_customerid(): - ''' returns customer in format needed for this API''' + ''' returns customer in "customers/C{customer}" format needed for this API''' customer = GC_Values[GC_CUSTOMER_ID] + if customer != MY_CUSTOMER and customer[0] != 'C': + customer = 'C' + customer return f'customers/{customer}' def _get_printer_attributes(i, cdapi=None):