Skip to content

Skeletal element category cannot be updated to empty in sample archaeology update form #300

Description

@gregsoos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions