From: Ben Darnell Date: Fri, 26 Aug 2022 19:06:18 +0000 (-0400) Subject: auth: Fix trailing comma and lint errors X-Git-Tag: v6.3.0b1~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3180%2Fhead;p=thirdparty%2Ftornado.git auth: Fix trailing comma and lint errors This slipped in with #3137 because that PR was submitted at a time when the CI config was broken and I didn't notice the incomplete run. --- diff --git a/tornado/auth.py b/tornado/auth.py index b16dd346e..627a25be6 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -857,13 +857,16 @@ class GoogleOAuth2Mixin(OAuth2Mixin): def get_google_oauth_settings(self) -> Dict[str, str]: """Return the Google OAuth 2.0 credentials that you created with - [Google Cloud Platform](https://console.cloud.google.com/apis/credentials). The dict format is: - { - "key": "your_client_id", - "secret": "your_client_secret" - } + [Google Cloud + Platform](https://console.cloud.google.com/apis/credentials). The dict + format is:: + + { + "key": "your_client_id", "secret": "your_client_secret" + } - If your credentials are stored differently (e.g. in a db) you can override this method for custom provision. + If your credentials are stored differently (e.g. in a db) you can + override this method for custom provision. """ handler = cast(RequestHandler, self) return handler.settings[self._OAUTH_SETTINGS_KEY] @@ -917,10 +920,12 @@ class GoogleOAuth2Mixin(OAuth2Mixin): The ``callback`` argument was removed. Use the returned awaitable object instead. """ # noqa: E501 - if not client_id: - client_id = self.get_google_oauth_settings()['key'], - if not client_secret: - client_secret = self.get_google_oauth_settings()['secret'], + if client_id is None or client_secret is None: + settings = self.get_google_oauth_settings() + if client_id is None: + client_id = settings["key"] + if client_secret is None: + client_secret = settings["secret"] http = self.get_auth_http_client() body = urllib.parse.urlencode( {