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

Return distinct source names from the facility API #1113

Merged
merged 2 commits into from Sep 23, 2020

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Sep 23, 2020

Overview

A problem with duplicate contributor names appearing on the facility detail page emerged when contributors began submitting the same facility via the API multiple times. To avoid this we update the facility serializer to process the list of sources and remove duplicates.

Connects https://github.com/open-apparel-registry/open-apparel-registry-clients/issues/12

Testing Instructions

{
    "country": "US",
    "address": "990 Spring Garden, Philadelphia",
    "name": "Azavea"
}
  • Go to the details page for the new facility and verify the unwanted behavior: the contributor appears twice.
  • Download and rename azavea.csv.txt to azavea.csv
  • Browse http://localhost:6543/contribute and upload the list without specifying a name
  • Run this command to create a bash helper function
function batch_process { ./scripts/manage batch_process --list-id $1 --action parse && ./scripts/manage batch_process --list-id $1 --action geocode && ./scripts/manage batch_process --list-id $1 --action match; }
  • Process the list with batch_process 16
  • Browse http://localhost:6543/contribute and submit the same list.
  • Process the list with batch_process 17
  • Browse the facility details page and verify that there are now 4 contributors, two API submissions and 2 list submissions
  • Checkout this branch and refresh the facility details page. Verify that there are now 2 items in the contributors list.

Checklist

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

@rajadain
Copy link
Contributor

Taking a look now

Copy link
Contributor

@rajadain rajadain left a comment

Choose a reason for hiding this comment

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

+1 tested works well. Great job on the detailed testing instructions.

@rajadain rajadain assigned jwalgran and unassigned rajadain Sep 23, 2020
A problem with duplicate contributor names appearing on the facility detail page
emerged when contributors began submitting the same facility via the API
multiple times. To avoid this we update the facility serializer to process the
list of sources and remove duplicates.
@jwalgran
Copy link
Contributor Author

Thanks for the review.

@jwalgran jwalgran merged commit c61f869 into develop Sep 23, 2020
@jwalgran jwalgran deleted the feature/jcw/distinct-sources branch September 23, 2020 21:12
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