Skeletal element category cannot be updated to empty in sample archaeology update form
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Suppose we want to update a sample via the sample archaeology update form (https://screening.reichdna.hms.harvard.edu/samples/sample_archaeology_update). If the sample begins with a skeletal element category assigned and we want to switch it to null/empty/nothing, the form currently cannot do so. This seems to be because of these lines in samples/intake.py:
if len(row.skeletal_element_category) > 0:
sample.skeletal_element_category = SkeletalElementCategory.objects.get(category__iexact=row.skeletal_element_category)
I.e. the sample's skeletal element category is only updated if we are trying to update it to something non-null/non-empty, making it impossible to update the category to null/empty.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in samples/intake.py at the skeletal_element_category update logic described in the issue, then trace how the sample archaeology update form passes an empty value. Verify the form can change an existing category to empty or null and that the sample remains cleared after the update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100