Skip to content

Commit

Permalink
connector_search_engine: store to_be_checked error
Browse files Browse the repository at this point in the history
Before this change the error was visible only in the job
if not deleted.
This we can provide more info to the end user
w/o the need for a new field.
This info will be wiped on the next successful compute.
  • Loading branch information
simahawk committed May 9, 2024
1 parent 4e1312a commit 0a7bf69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions connector_search_engine/models/se_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def _recompute_json(self, force_export=False):
vals["date_modified"] = fields.Datetime.now()
if error:
vals["sync_state"] = "to_be_checked"
vals["data"]["__error__"] = error
binding.write(vals)
if validation_errors:
result.append(
Expand Down
3 changes: 3 additions & 0 deletions connector_search_engine/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ def test_recompute_json_to_be_checked(self):
"Validation errors:\n\n "
f"Something wrong with data - IDs: {self.partner_binding.id}",
)
self.assertEqual(
self.partner_binding.data["__error__"], "Something wrong with data"
)

def test_recompute_json_to_be_checked_rollback(self):
# If something was to check but it's now good,
Expand Down

0 comments on commit 0a7bf69

Please sign in to comment.