Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
179
Issues
179
List
Boards
Labels
Milestones
Merge Requests
53
Merge Requests
53
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
a0f325d6
Commit
a0f325d6
authored
Jan 04, 2021
by
Florent Viard
Committed by
Vincent A
Jan 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[boursorama] Fixes new_recipient when called by the backend from a bank openapi account
parent
80b13e34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
modules/boursorama/browser.py
modules/boursorama/browser.py
+14
-2
No files found.
modules/boursorama/browser.py
View file @
a0f325d6
...
...
@@ -45,7 +45,7 @@ from weboob.capabilities.bank import (
from
weboob.capabilities.base
import
NotLoaded
,
empty
,
find_object
,
strict_find_object
from
weboob.capabilities.contact
import
Advisor
from
weboob.tools.value
import
Value
from
weboob.tools.compat
import
basestring
,
urlsplit
from
weboob.tools.compat
import
urlsplit
from
weboob.tools.capabilities.bank.transactions
import
sorted_transactions
from
weboob.tools.capabilities.bank.bank_transfer
import
sorted_transfers
...
...
@@ -703,6 +703,10 @@ class BoursoramaBrowser(RetryLoginBrowser, TwoFactorBrowser):
raise
TransferInvalidEmitter
(
'The account cannot emit transfers'
)
recipients
=
[
rcpt
for
rcpt
in
recipients
if
rcpt
.
id
==
transfer
.
recipient_id
]
if
len
(
recipients
)
==
0
and
not
empty
(
transfer
.
recipient_iban
):
# try to find recipients by iban:
recipients
=
[
rcpt
for
rcpt
in
recipients
if
not
empty
(
rcpt
.
iban
)
and
rcpt
.
iban
==
transfer
.
recipient_iban
]
if
len
(
recipients
)
==
0
:
raise
TransferInvalidRecipient
(
'The recipient cannot be used with the emitter account'
)
assert
len
(
recipients
)
==
1
...
...
@@ -802,6 +806,10 @@ class BoursoramaBrowser(RetryLoginBrowser, TwoFactorBrowser):
break
elif
account
.
id
==
recipient
.
origin_account_id
:
break
elif
(
not
empty
(
recipient
.
origin_account_iban
)
and
not
empty
(
account
.
iban
)
and
account
.
iban
==
recipient
.
origin_account_iban
):
break
else
:
raise
AddRecipientBankError
(
message
=
"Compte ne permettant pas l'ajout de bénéficiaires"
)
...
...
@@ -895,7 +903,11 @@ class BoursoramaBrowser(RetryLoginBrowser, TwoFactorBrowser):
# here we just want to return the right Recipient object.
# We are taking it from the recipient list page
# because there is no summary of the adding
self
.
go_recipients_list
(
account_url
,
recipient
.
origin_account_id
)
account
=
self
.
get_account
(
recipient
.
origin_account_id
,
recipient
.
origin_account_iban
)
if
not
account
:
raise
AccountNotFound
()
self
.
go_recipients_list
(
account_url
,
account
.
id
)
return
find_object
(
self
.
page
.
iter_recipients
(),
iban
=
recipient
.
iban
,
error
=
RecipientNotFound
)
@
need_login
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment