feat: mypy for all type check (#10921)
This commit is contained in:
parent
c91e8b1737
commit
56e15d09a9
584 changed files with 3975 additions and 2826 deletions
|
|
@ -77,9 +77,9 @@ class GitHubOAuth(OAuth):
|
|||
|
||||
email_response = requests.get(self._EMAIL_INFO_URL, headers=headers)
|
||||
email_info = email_response.json()
|
||||
primary_email = next((email for email in email_info if email["primary"] == True), None)
|
||||
primary_email: dict = next((email for email in email_info if email["primary"] == True), {})
|
||||
|
||||
return {**user_info, "email": primary_email["email"]}
|
||||
return {**user_info, "email": primary_email.get("email", "")}
|
||||
|
||||
def _transform_user_info(self, raw_info: dict) -> OAuthUserInfo:
|
||||
email = raw_info.get("email")
|
||||
|
|
@ -130,4 +130,4 @@ class GoogleOAuth(OAuth):
|
|||
return response.json()
|
||||
|
||||
def _transform_user_info(self, raw_info: dict) -> OAuthUserInfo:
|
||||
return OAuthUserInfo(id=str(raw_info["sub"]), name=None, email=raw_info["email"])
|
||||
return OAuthUserInfo(id=str(raw_info["sub"]), name="", email=raw_info["email"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue