Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanabalagi committed Jul 20, 2023
1 parent 4f0907c commit 1050ebe
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import logging

from odoo import fields, models
from odoo import fields, models, _
from odoo.exceptions import UserError

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -35,13 +35,13 @@ def _parse_file(self, data_file):
)
except KeyError as e:
e_str = f"Could not find value for {e.args[0]!r}"
raise UserError(f"Failed to parse uploaded file!\n{e_str}")
raise UserError(_(f"Failed to parse uploaded file!\n{e_str}"))

Check warning on line 38 in account_statement_import_txt_xlsx/models/account_statement_import.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_txt_xlsx/models/account_statement_import.py#L37-L38

Added lines #L37 - L38 were not covered by tests
except ValueError as e:
e_str = f"Problem with a value in file\n{e}"
raise UserError(f"Failed to parse uploaded file!\n{e_str}")
except BaseException as e:
raise UserError(_(f"Failed to parse uploaded file!\n{e_str}"))

Check warning on line 41 in account_statement_import_txt_xlsx/models/account_statement_import.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_txt_xlsx/models/account_statement_import.py#L40-L41

Added lines #L40 - L41 were not covered by tests
except BaseException:
if self.env.context.get("account_statement_import_txt_xlsx_test"):
raise UserError("Failed to parse uploaded file!")
raise UserError(_("Failed to parse uploaded file!"))

Check warning on line 44 in account_statement_import_txt_xlsx/models/account_statement_import.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_txt_xlsx/models/account_statement_import.py#L44

Added line #L44 was not covered by tests
_logger.warning("Sheet parser error", exc_info=True)
return super()._parse_file(data_file)

Expand Down

0 comments on commit 1050ebe

Please sign in to comment.