@@ -857,13 +857,16 @@ class GoogleOAuth2Mixin(OAuth2Mixin):
857857
858858 def get_google_oauth_settings (self ) -> Dict [str , str ]:
859859 """Return the Google OAuth 2.0 credentials that you created with
860- [Google Cloud Platform](https://console.cloud.google.com/apis/credentials). The dict format is:
861- {
862- "key": "your_client_id",
863- "secret": "your_client_secret"
864- }
860+ [Google Cloud
861+ Platform](https://console.cloud.google.com/apis/credentials). The dict
862+ format is::
863+
864+ {
865+ "key": "your_client_id", "secret": "your_client_secret"
866+ }
865867
866- If your credentials are stored differently (e.g. in a db) you can override this method for custom provision.
868+ If your credentials are stored differently (e.g. in a db) you can
869+ override this method for custom provision.
867870 """
868871 handler = cast (RequestHandler , self )
869872 return handler .settings [self ._OAUTH_SETTINGS_KEY ]
@@ -917,10 +920,12 @@ async def get(self):
917920 The ``callback`` argument was removed. Use the returned awaitable object instead.
918921 """ # noqa: E501
919922
920- if not client_id :
921- client_id = self .get_google_oauth_settings ()['key' ],
922- if not client_secret :
923- client_secret = self .get_google_oauth_settings ()['secret' ],
923+ if client_id is None or client_secret is None :
924+ settings = self .get_google_oauth_settings ()
925+ if client_id is None :
926+ client_id = settings ["key" ]
927+ if client_secret is None :
928+ client_secret = settings ["secret" ]
924929 http = self .get_auth_http_client ()
925930 body = urllib .parse .urlencode (
926931 {
0 commit comments