Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Move the exception of missing 'realm_access section' into the model itself #62

Merged
merged 3 commits into from
Jul 23, 2022

Conversation

fherrera124
Copy link
Contributor

@fherrera124 fherrera124 commented Jul 22, 2022

With this patch, if the realm_access section is missing in the access token, then:

user=idp.get_current_user(...)
print(user.roles)

will raise an exception describing the error.
The current behavior is:

....
    return self.realm_access["roles"]
TypeError: 'NoneType' object is not subscriptable
....

@fherrera124 fherrera124 changed the title Avoid TypeError: 'NoneType' object is not subscriptable Move the error of missing 'realm_access section' into the model itself Jul 22, 2022
@fherrera124 fherrera124 changed the title Move the error of missing 'realm_access section' into the model itself Move the exception of missing 'realm_access section' into the model itself Jul 22, 2022
Copy link
Collaborator

@JonasScholl JonasScholl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@yannicschroeer yannicschroeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JonasScholl JonasScholl merged commit 35a3f60 into code-specialist:master Jul 23, 2022
@fherrera124 fherrera124 deleted the fherrera124-patch-1 branch July 24, 2022 00:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants