Skip to content

Commit

Permalink
Entitlements are already present
Browse files Browse the repository at this point in the history
  • Loading branch information
brodokk committed Nov 22, 2023
1 parent 48bb04d commit c3637dc
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions resonitepy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,20 @@ def getUserData(self, user: str = None) -> ResoniteUser:
if user is None:
user = self.userId
response = self._request('get', "/users/" + user)
entitlements = []
for entitlement in response['entitlements']:
if '$type' in entitlement:
entitlement_type = entitlement['$type']
del entitlement['$type']
entitlements.append(
dacite.from_dict(
resoniteUserEntitlementTypeMapping[entitlement_type],
entitlement,
DACITE_CONFIG
if 'entitlements' in response:
entitlements = []
for entitlement in response['entitlements']:
if '$type' in entitlement:
entitlement_type = entitlement['$type']
del entitlement['$type']
entitlements.append(
dacite.from_dict(
resoniteUserEntitlementTypeMapping[entitlement_type],
entitlement,
DACITE_CONFIG
)
)
)
response['entitlements'] = entitlements
response['entitlements'] = entitlements
return dacite.from_dict(ResoniteUser, response, DACITE_CONFIG)

def getSession(self, session_id: str) -> ResoniteSession:
Expand Down

0 comments on commit c3637dc

Please sign in to comment.