diff --git a/api/graphql/schema.py b/api/graphql/schema.py index ecfb1c1a4..37d3f97b1 100644 --- a/api/graphql/schema.py +++ b/api/graphql/schema.py @@ -161,6 +161,8 @@ async def families( id: GraphQLFilter[int] | None = None, external_id: GraphQLFilter[str] | None = None, ) -> list['GraphQLFamily']: + # don't need a data loader here as we're presuming we're not often running + # the "families" method for many projects at once. If so, we might need to fix that connection = info.context['connection'] families = await FamilyLayer(connection).query( FamilyFilter( diff --git a/db/python/layers/family.py b/db/python/layers/family.py index 344032d16..63015fa1a 100644 --- a/db/python/layers/family.py +++ b/db/python/layers/family.py @@ -200,9 +200,9 @@ async def get_pedigree( mapped_rows.append( { 'family_id': fmap.get(r.family_id, str(r.family_id)), - 'individual_id': pmap.get(r.individual_id, empty_participant_value), - 'paternal_id': pmap.get(r.paternal_id, empty_participant_value), - 'maternal_id': pmap.get(r.maternal_id, empty_participant_value), + 'individual_id': pmap.get(r.individual_id, r.individual_id) or empty_participant_value, + 'paternal_id': pmap.get(r.paternal_id, r.paternal_id) or empty_participant_value), + 'maternal_id': pmap.get(r.maternal_id, r.maternal_id) or empty_participant_value), 'sex': r.sex, 'affected': r.affected, 'notes': r.notes, diff --git a/db/python/tables/family_participant.py b/db/python/tables/family_participant.py index 1808a2348..53b774d0c 100644 --- a/db/python/tables/family_participant.py +++ b/db/python/tables/family_participant.py @@ -199,7 +199,7 @@ async def delete_family_participant_row(self, family_id: int, participant_id: in _update_before_delete = """ UPDATE family_participant - set audit_log_id = :audit_log_id + SET audit_log_id = :audit_log_id WHERE family_id = :family_id AND participant_id = :participant_id """