Skip to content

Commit

Permalink
[FIX] account_statement_import_online_ponto: Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed Oct 28, 2023
1 parent e8a5ecf commit 1cc6b4a
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def _ponto_header(self):
)
self.sudo().ponto_token_expiration = expiration_date
else:
raise UserError(
_("{} \n\n {}").format(response.status_code, response.text)
)
raise UserError(f"{response.status_code}\n\n {response.text}")

Check warning on line 86 in account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py#L86

Added line #L86 was not covered by tests
return {
"Accept": "application/json",
"Authorization": "Bearer %s" % self.ponto_token,
Expand All @@ -105,7 +103,7 @@ def _ponto_get_account_ids(self):
)
res[iban] = account.get("id")
return res
raise UserError(_("{} \n\n {}").format(response.status_code, response.text))
raise UserError(f"{response.status_code}\n\n {response.text}")

Check warning on line 106 in account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py#L106

Added line #L106 was not covered by tests

def _ponto_synchronisation(self, account_id):
url = PONTO_ENDPOINT + "/synchronizations"
Expand All @@ -125,9 +123,11 @@ def _ponto_synchronisation(self, account_id):
sync_id = data.get("attributes", {}).get("resourceId", False)
else:
raise UserError(
_("Error during Create Synchronisation {} \n\n {}").format(
response.status_code, response.text
)
_("Error during Create Synchronization %(code)s \n\n %(text)s")
% {
"code": response.status_code,
"text": response.text,
}
)

# Check synchronisation
Expand Down Expand Up @@ -161,9 +161,11 @@ def _ponto_get_transaction(self, account_id, date_since, date_until):
)
if response.status_code != 200:
raise UserError(
_("Error during get transaction.\n\n{} \n\n {}").format(
response.status_code, response.text
)
_("Error during get transaction.\n\n%(code)s\n\n%(text)s")
% {
"code": response.status_code,
"text": response.text,
}
)
if params.get("before"):
params.pop("before")
Expand Down

0 comments on commit 1cc6b4a

Please sign in to comment.