From 41a2054d6488930972209d3f0ca8108e9be3a691 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 9 Jan 2020 11:01:45 +0100 Subject: [PATCH] Execute commit conditionally for postbank only --- fints/client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fints/client.py b/fints/client.py index def8874..6794cee 100644 --- a/fints/client.py +++ b/fints/client.py @@ -1344,8 +1344,15 @@ class FinTS3PinTanClient(FinTS3Client): """Get information about TAN lists/generators. Returns tuple of fints.formals.TANUsageOption and a list of fints.formals.TANMedia4 or fints.formals.TANMedia5 objects.""" + if self.connection.url == 'https://hbci.postbank.de/banking/hbci.do': + context = self._new_dialog(lazy_init=True) + method = lambda dialog: dialog.init + else: + context = self._get_dialog() + method = lambda dialog: dialog.send + - with self._new_dialog(lazy_init=True) as dialog: + with context as dialog: hktab = self._find_highest_supported_command(HKTAB4, HKTAB5) seg = hktab( @@ -1357,7 +1364,7 @@ class FinTS3PinTanClient(FinTS3Client): try: self._bootstrap_mode = True - response = dialog.init(seg) + response = method(dialog)(seg, tan_seg=seg) finally: self._bootstrap_mode = False -- 2.47.2