Skip to content

Commit

Permalink
fix AccessToken.fetch_resources error when no resources
Browse files Browse the repository at this point in the history
  • Loading branch information
treeben77 committed Sep 25, 2023
1 parent 872fd0a commit bdc1a63
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions rblxopencloud/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,19 @@ def fetch_resources(self) -> Resources:

experiences = []
accounts = []

for resource in response.json()["resource_infos"]:
owner = resource["owner"]
for experience_id in resource["resources"]["universe"]["ids"]:
experience = Experience(experience_id, f"Bearer {self.token}")
if owner["type"] == "User":
experience.owner = User(owner["id"], f"Bearer {self.token}")
elif owner["type"] == "Group":
experience.owner = Group(owner["id"], f"Bearer {self.token}")
experiences.append(experience)

if owner["type"] == "User":
if resource["resources"].get("universe"):
for experience_id in resource["resources"]["universe"]["ids"]:
experience = Experience(experience_id, f"Bearer {self.token}")
if owner["type"] == "User":
experience.owner = User(owner["id"], f"Bearer {self.token}")
elif owner["type"] == "Group":
experience.owner = Group(owner["id"], f"Bearer {self.token}")
experiences.append(experience)

if resource["resources"].get("creator"):
for creator_id in resource["resources"]["creator"]["ids"]:
if creator_id == "U":
accounts.append(User(owner["id"], f"Bearer {self.token}"))
Expand Down

0 comments on commit bdc1a63

Please sign in to comment.