From fe501fbb012b6970d666748c88f520339cc9c675 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 26 Aug 2022 15:06:18 -0400 Subject: [PATCH] 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. --- tornado/auth.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) 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( { -- 2.47.2