Breeding-Insight / sgn

The code behind the Sol Genomics Network, Cassavabase and BreeDBase websites
https://solgenomics.net
MIT License
2 stars 0 forks source link

BI-1756 - Migration 1.0.13 failed on QA-Test #116

Closed timparsons closed 1 year ago

timparsons commented 1 year ago

Description

When trying to update a location, if the name did not change, then the BrAPI code would throw a validation error because there is already a location with the same name in the database (the one trying to be updated). Updated the code to look for any other locations that have the same name and not the same ID as the location trying to be updated.

Testing

  1. Create a location via BrAPI (can use DeltaBreed)

  2. Make a PUT call to update the newly created location. Make sure to NOT update the name.

  3. Verify save is successful

  4. Create two locations via BrAPI (can use DeltaBreed)

  5. Try to update one of the locations to have the same name as the other

  6. Verify the save fails

Checklist