This commit is contained in:
Ross Scroggs
2025-08-15 15:03:51 -07:00

View File

@@ -44907,10 +44907,15 @@ def getUserLicenses(lic, user, skus):
licenses.append(response['skuId'])
del sku_calls[request_id]
else:
if exception.reason == not_found:
_, reason, _ = checkGAPIError(exception, softErrors=True)
reasons_to_quit = [
GAPI.ACCESS_NOT_CONFIGURED, # license API not turned on
GAPI.PERMISSION_DENIED, # Admin doesn't have rights to license assignments
GAPI.NOT_FOUND # API call succeeded, user does not have this license
]
if reason in reasons_to_quit:
del sku_calls[request_id]
not_found = 'User does not have a license for specified sku and product'
licenses = []
svcargs = dict([('userId', user['primaryEmail']), ('productId', None), ('skuId', None), ('fields', 'skuId')]+GM.Globals[GM.EXTRA_ARGS_LIST])
method = getattr(lic.licenseAssignments(), 'get')