Skip to content

Commit

Permalink
fixup! Enable import from bank account if TAN is required after login
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed Sep 30, 2024
1 parent 853f17a commit df85301
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions web/blueprints/finance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:copyright: (c) 2012 by AG DSN.
"""
import logging
import typing as t
from base64 import b64encode, b64decode
from decimal import Decimal
Expand Down Expand Up @@ -147,6 +148,7 @@
bp = Blueprint('finance', __name__)
access = BlueprintAccess(bp, required_properties=['finance_show'])
nav = BlueprintNavigation(bp, "Finanzen", icon='fa-euro-sign', blueprint_access=access)
logger = logging.getLogger(__name__)


@bp.route('/')
Expand Down Expand Up @@ -269,11 +271,16 @@ def bank_accounts_login(bank_account_id: int, action: str) -> ResponseReturnValu
mechanisms = client.get_tan_mechanisms()

if "913" in mechanisms:
client.set_tan_mechanism("913") # QR-Code
elif "910" in mechanisms:
client.set_tan_mechanism("910") # Manual
client.set_tan_mechanism("913") # chipTAN-QR
else:
raise ValueError("We don't like any of the mechanisms.")
logger.error("FinTS: No suitable TAN mechanism available.", exc_info=True)
flash(
f"TAN-Verfahren „chipTAN-QR“ wird benötigt, jedoch sind am FinTS-Endpunkt nur folgende Verfahren verfügbar: {', '.join(m.name for m in mechanisms.values())}.",
"error",
)
return redirect(
url_for(".bank_accounts_login", bank_account_id=bank_account_id, action=action)
)

with client:
if client.init_tan_response:
Expand Down

0 comments on commit df85301

Please sign in to comment.