From 7c9e6550bc4ee5516b5c59593cd303c125832d37 Mon Sep 17 00:00:00 2001 From: Hana Snow Date: Mon, 22 Jan 2024 11:50:34 -0500 Subject: [PATCH] clearer sex mismatch error --- seqr/views/apis/individual_api_tests.py | 6 +++--- seqr/views/utils/pedigree_info_utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/seqr/views/apis/individual_api_tests.py b/seqr/views/apis/individual_api_tests.py index 031b81da82..deb032ac55 100644 --- a/seqr/views/apis/individual_api_tests.py +++ b/seqr/views/apis/individual_api_tests.py @@ -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) @@ -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', ], diff --git a/seqr/views/utils/pedigree_info_utils.py b/seqr/views/utils/pedigree_info_utils.py index 53b75cda16..1fd71bef1c 100644 --- a/seqr/views/utils/pedigree_info_utils.py +++ b/seqr/views/utils/pedigree_info_utils.py @@ -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]