Skip to content

Commit

Permalink
Merge branch 'master' into issue_2054
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasP0815 authored Apr 2, 2024
2 parents ad5ebfb + c65e067 commit 9cced56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/quickcharts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Direct Data Charts
These charts can display multiple series, based on columns or methods defined on models.
You can display multiple charts on the same view.

Let's create a simple model first, the gold is to display a chart showing the unemployment evolution
Let's create a simple model first, the goal is to display a chart showing the unemployment evolution
versus the percentage of the population with higher education, our model will be::

class CountryStats(Model):
Expand Down Expand Up @@ -126,7 +126,7 @@ You can display multiple charts on the same view. This data can be grouped and a

Let's create some simple models first, base on the prior example but this time lets make our models
support has many countries has we like.
The gold is to display a chart showing the unemployment
The goal is to display a chart showing the unemployment
versus the percentage of the population with higher education per country::

from flask_appbuilder import Model
Expand Down
18 changes: 11 additions & 7 deletions flask_appbuilder/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,13 +660,17 @@ def get_oauth_user_info(
me = self.appbuilder.sm.oauth_remotes[provider].get("userinfo")
data = me.json()
log.debug("User info from Okta: %s", data)
return {
"username": f"{provider}_{data['sub']}",
"first_name": data.get("given_name", ""),
"last_name": data.get("family_name", ""),
"email": data["email"],
"role_keys": data.get("groups", []),
}
if "error" not in data:
return {
"username": f"{provider}_{data['sub']}",
"first_name": data.get("given_name", ""),
"last_name": data.get("family_name", ""),
"email": data["email"],
"role_keys": data.get("groups", []),
}
else:
log.error(data.get("error_description"))
return {}
# for Auth0
if provider == "auth0":
data = self.appbuilder.sm.oauth_remotes[provider].userinfo()
Expand Down

0 comments on commit 9cced56

Please sign in to comment.