Open
Description
Description
create_org()
calls _get_guid_by_id()
with id_key="orgUid"
. This triggers the following code:
if id_key != "orgId":
guid = ""
page = self.get_page()
for org in page["orgs"]:
if org[id_key] == org_id:
return org["orgGuid"]
if not guid:
raise Py42Error(f"Couldn't find an Org with ID '{org_id}'.")
This code calls self.get_page() which will only return the first 500. If the uid being searched for is not in the first 500 this will return an error even if the org exists. In our example org this included the parent org ID.
Steps to Reproduce
- Have an org with over 500 orgs
- Create an org with the parent of one of those not returned in the first 500
- An error will occur
Expected Behavior
Org will be created
Actual Behavior
Py42Error is thrown
Basic Information
- py42 version: 1.26.1
- python version: 3.11.4
- operating system: MacOS