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

Account() doesn't correctly get account details #26

Closed
bryanheinz opened this issue Apr 19, 2021 · 1 comment
Closed

Account() doesn't correctly get account details #26

bryanheinz opened this issue Apr 19, 2021 · 1 comment
Labels
bug Something isn't working resolved in dev Resolved in the dev branch, but not committed to main yet.

Comments

@bryanheinz
Copy link
Collaborator

Account() returns an array with only ['type', 'attributes'] instead of a dictionary with the account details.

>>> import SimpleMDMpy
>>> print(SimpleMDMpy.Account(api_key).get_account_details())
['type', 'attributes']

Expected output (something like): {'data': {'attributes': {'apple_store_country_code': 'US', 'name': 'Example Corp'}, 'type': 'account'}}

I believe this is due to [resp_data.extend](https://github.com/macadmins/simpleMDMpy/blob/5221aa32548e2468ade4b92f700d7ebc9d826699/SimpleMDMpy/SimpleMDM.py#L40].

I think changing resp_data to a dictionary resp_data = {} and using resp_data.update(resp_json) might be a better approach and would resolve this.

Alternatively we could leave resp_data as an Array and change resp_data.extend to resp_data.append, which I think would resolve this.

Either of these changes are likely to introduce more bugs.

@bryanheinz bryanheinz added the bug Something isn't working label Apr 19, 2021
bryanheinz added a commit to bryanheinz/simpleMDMpy that referenced this issue Apr 19, 2021
@bryanheinz
Copy link
Collaborator Author

i was wrong and @MagerValp has a potential resolution that needs to be tested, PR'd, and reviewed on the return_one branch.

bryanheinz added a commit to bryanheinz/simpleMDMpy that referenced this issue Nov 5, 2021
- Return single items without wrapping in list
- Fix calls that return a single item.
- Resolves issue macadmins#26
bryanheinz added a commit that referenced this issue Jan 17, 2022
- Closes issue #24
- Closes issue #38
- Closes issue #25
- Closes issue #26
@bryanheinz bryanheinz added the resolved in dev Resolved in the dev branch, but not committed to main yet. label May 30, 2022
@MagerValp MagerValp mentioned this issue Dec 1, 2022
@rickheil rickheil closed this as completed Dec 7, 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 resolved in dev Resolved in the dev branch, but not committed to main yet.
Projects
None yet
Development

No branches or pull requests

2 participants