This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 4dcab4ea972d9c90492fbe936eb0fc862368aa8a
Author: Daniel Gruno <[email protected]>
AuthorDate: Sun May 9 19:44:23 2021 +0200

    PEP8 linting
---
 server/plugins/oauthGithub.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/server/plugins/oauthGithub.py b/server/plugins/oauthGithub.py
index 5c45094..47ede9b 100644
--- a/server/plugins/oauthGithub.py
+++ b/server/plugins/oauthGithub.py
@@ -14,16 +14,18 @@ import plugins.server
 import typing
 
 
-async def process(
-    formdata, session, server: plugins.server.BaseServer
-) -> typing.Optional[dict]:
+async def process(formdata, session, server: plugins.server.BaseServer) -> 
typing.Optional[dict]:
     formdata["client_id"] = server.config.oauth.github_client_id
     formdata["client_secret"] = server.config.oauth.github_client_secret
-    headers = {'Accept': 'application/json'}
-    with aiohttp.client.request("POST", 
"https://github.com/login/oauth/access_token";, headers=headers, data=formdata) 
as rv:
+    headers = {"Accept": "application/json"}
+    with aiohttp.client.request(
+        "POST", "https://github.com/login/oauth/access_token";, 
headers=headers, data=formdata
+    ) as rv:
         resp = await rv.json()
-        if 'access_token' in resp:
-            with aiohttp.client.request("GET", "https://api.github.com/user";, 
headers={"authorization": "token %s" % resp['access_token']}) as orv:
+        if "access_token" in resp:
+            with aiohttp.client.request(
+                "GET", "https://api.github.com/user";, 
headers={"authorization": "token %s" % resp["access_token"]}
+            ) as orv:
                 js = await orv.json()
                 js["oauth_domain"] = "github.com"
                 # Full name and email address might not always be available to 
us. Fake it till you make it.

Reply via email to