Skip to content

Commit

Permalink
[REF] l10n_br_account_payment_brcobranca: Solve 'E8106(external-reque…
Browse files Browse the repository at this point in the history
…st-timeout) Use of external request method without timeout. It could wait for a long time.'
  • Loading branch information
mbcosta committed Aug 15, 2024
1 parent 9baace4 commit f4b4bea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion l10n_br_account_payment_brcobranca/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ def _get_brcobranca_boleto(self, boletos):
brcobranca_service_url,
self.name,
)
res = requests.post(brcobranca_service_url, data={"type": "pdf"}, files=files)
res = requests.post(

Check warning on line 74 in l10n_br_account_payment_brcobranca/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_move.py#L74

Added line #L74 was not covered by tests
brcobranca_service_url,
data={"type": "pdf"},
files=files,
timeout=300,
)

if str(res.status_code)[0] == "2":
pdf_string = res.content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def _get_brcobranca_remessa(self, bank_brcobranca, remessa_values, cnab_type):
"bank": bank_brcobranca.name,
},
files=files,
timeout=300,
)

if cnab_type == "240" and "R01" in res.text[242:254]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def _get_brcobranca_retorno(self, files):
"bank": bank_name_brcobranca,
},
files=files,
timeout=300,
)

if res.status_code != 201:
Expand Down

0 comments on commit f4b4bea

Please sign in to comment.