Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] create_org may not work due to limited return size. #459

Open
csanders-git opened this issue Sep 17, 2023 · 0 comments
Open

[Bug] create_org may not work due to limited return size. #459

csanders-git opened this issue Sep 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@csanders-git
Copy link
Contributor

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

  1. Have an org with over 500 orgs
  2. Create an org with the parent of one of those not returned in the first 500
  3. 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
@csanders-git csanders-git added the bug Something isn't working label Sep 17, 2023
csanders-git added a commit to csanders-git/py42 that referenced this issue Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant