Skip to content

Commit

Permalink
Dont let sex be null on change
Browse files Browse the repository at this point in the history
  • Loading branch information
Mropat committed Mar 15, 2022
1 parent fcb9d21 commit ac18fe3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genotype_api/api/endpoints/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def update_sex(
sample_in_db: Sample = get_sample(session=session, sample_id=sample_id)
sample_in_db.sex = sex
for analysis in sample_in_db.analyses:
if analysis.type == "genotype":
if genotype_sex and analysis.type == "genotype":
analysis.sex = genotype_sex
elif analysis.type == "sequence":
elif sequence_sex and analysis.type == "sequence":
analysis.sex = sequence_sex
session.add(analysis)
session.add(sample_in_db)
Expand Down

0 comments on commit ac18fe3

Please sign in to comment.