Skip to content

Commit

Permalink
clearer sex mismatch error
Browse files Browse the repository at this point in the history
  • Loading branch information
hanars committed Jan 22, 2024
1 parent 592983d commit 7c9e655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions seqr/views/apis/individual_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_edit_individuals(self, mock_pm_group):
self.assertEqual(response.status_code, 400)
self.assertListEqual(response.json()['errors'], [
'Invalid parental guid I000020_na65432',
'NA21234 sex is recorded as Female and also as the father of NA21987',
'NA21234 is recorded as Female sex and also as the father of NA21987',
])

update_json = deepcopy(EXTERNAL_WORKSPACE_INDIVIDUAL_UPDATE_DATA)
Expand Down Expand Up @@ -441,8 +441,8 @@ def test_individuals_table_handler_errors(self):
'errors': [
'Invalid proband relationship "Father" for NA19675_1 with given gender Female',
'NA19675_1 is recorded as their own father',
'NA19675_1 sex is recorded as Female and also as the father of NA19675_1',
'NA19675_1 sex is recorded as Female and also as the father of NA19675_2',
'NA19675_1 is recorded as Female sex and also as the father of NA19675_1',
'NA19675_1 is recorded as Female sex and also as the father of NA19675_2',
'NA19675_1 is recorded as the father of NA19675_2 but they have different family ids: 1 and 2',
'NA19675_1 is included as 2 separate records, but must be unique within the project',
],
Expand Down
2 changes: 1 addition & 1 deletion seqr/views/utils/pedigree_info_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def validate_fam_file_records(records, fail_on_warnings=False, errors=None):
actual_sex = records_by_id[parent_id][JsonConstants.SEX_COLUMN]
if actual_sex != expected_sex:
actual_sex_label = dict(Individual.SEX_CHOICES)[actual_sex]
errors.append("%(parent_id)s sex is recorded as %(actual_sex_label)s and also as the %(parent_id_type)s of %(individual_id)s" % locals())
errors.append("%(parent_id)s is recorded as %(actual_sex_label)s sex and also as the %(parent_id_type)s of %(individual_id)s" % locals())

# is the parent in the same family?
parent = records_by_id[parent_id]
Expand Down

0 comments on commit 7c9e655

Please sign in to comment.