Skip to content

Commit

Permalink
Merge pull request #429 from NelsonDane/deepsource-transform-c94a8b8a
Browse files Browse the repository at this point in the history
style: format code with Black and isort
  • Loading branch information
NelsonDane authored Nov 4, 2024
2 parents 7d99d29 + e16139b commit 364f830
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions sofiAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,15 @@ async def handle_2fa(page, account, name, botObj, discord_loop):
secret = None
if secret is not None:
try:
remember = await asyncio.wait_for(page.select("input[id=rememberBrowser]"), timeout=5)
remember = await asyncio.wait_for(
page.select("input[id=rememberBrowser]"), timeout=5
)
if remember:
await remember.click()
except asyncio.TimeoutError:
print(f"'rememberBrowser' checkbox not found for {name}. Continuing without it...")
print(
f"'rememberBrowser' checkbox not found for {name}. Continuing without it..."
)

# Continue with 2FA input
twofa_input = await page.select("input[id=code]")
Expand Down Expand Up @@ -443,11 +447,15 @@ async def handle_2fa(page, account, name, botObj, discord_loop):
if sms_2fa_element:
# SMS 2FA handling
try:
remember = await asyncio.wait_for(page.select("input[id=rememberBrowser]"), timeout=5)
remember = await asyncio.wait_for(
page.select("input[id=rememberBrowser]"), timeout=5
)
if remember:
await remember.click()
except asyncio.TimeoutError:
print(f"'rememberBrowser' checkbox not found for {name}. Continuing without it...")
print(
f"'rememberBrowser' checkbox not found for {name}. Continuing without it..."
)

sms2fa_input = await page.select("input[id=code]")
if not sms2fa_input:
Expand Down

0 comments on commit 364f830

Please sign in to comment.