Skip to content

Commit d1e1230

Browse files
committed
fix mypy errors
1 parent 3f24812 commit d1e1230

2 files changed

Lines changed: 462 additions & 355 deletions

File tree

dataall_core/auth/custom_auth.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import bs4
1313
import httpx
14+
from bs4 import Tag
1415

1516
from dataall_core.auth import AuthorizationClass
1617
from dataall_core.profile import Profile
@@ -129,12 +130,12 @@ def get_authorization_code(
129130
response.raise_for_status()
130131

131132
page = bs4.BeautifulSoup(response.text, "html.parser")
132-
params = {
133-
e["name"]: e.get("value", "")
134-
for e in page.find_all("input", {"name": True})
135-
}
133+
params = {}
134+
for e in page.find_all("input", {"name": True}):
135+
if isinstance(e, Tag) and e.get("name"):
136+
params[str(e["name"])] = str(e.get("value", ""))
136137

137-
return params["code"], code_verifier
138+
return str(params.get("code", "")), code_verifier
138139

139140
def _get_token_custom(
140141
self, token_endpoint: str, code: str, code_verifier: str

0 commit comments

Comments
 (0)