Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Handle create=false when exact matching #1594

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

TaiWilkin
Copy link
Contributor

@TaiWilkin TaiWilkin commented Jan 18, 2022

Overview

When a facility list item is submitted with create=false and there is
no match found, a FacilityListItem is created with facility_id=None.
When another facility list item is submitted which exact matches that
FacilityListItem, an error was being thrown. Instead, we now filter
out FacilityListItems where the facility_id=None, allowing us to match
to the next best option (if one exists) or pass the FacilityListItem
on to the dedupe process.

Connects #1580

Testing Instructions

  • Not on this branch, browse /api/docs/#!/facilities/facilities_create authorize with an API token
  • Submit a facility with create=false twice. The second submission should result in ERROR_MATCHING
{
    "country": "Turkey",
    "name": "BAŞARI TEKSTİL",
    "address": "Merkezefendi"
}
  • Switch to this branch and resubmit the facility. The submission should not throw an error.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed!

@jwalgran jwalgran assigned TaiWilkin and unassigned jwalgran Jan 19, 2022
When a facility list item is submitted with create=false and there is
no match found, a FacilityListItem is created with facility_id=None.
When another facility list item is submitted which exact matches that
FacilityListItem, an error was being thrown. Instead, we now filter
out FacilityListItems where the facility_id=None, allowing us to match
to the next best option (if one exists) or pass the FacilityListItem
on to the dedupe process.
@TaiWilkin
Copy link
Contributor Author

Thanks for reviewing!

@TaiWilkin TaiWilkin merged commit a91fac2 into develop Jan 20, 2022
@TaiWilkin TaiWilkin deleted the tw/handle-create-false branch January 20, 2022 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants