Show just surnames for an unnamed family, not "... family"
An unnamed family with distinct member surnames read as "Jones / Smith family" -- dropping the suffix reads more like an actual family name.
This commit is contained in:
@@ -19,7 +19,7 @@ class Family(UUIDModel):
|
||||
return self.name
|
||||
surnames = sorted({last_name for last_name in self.memberships.values_list("member__last_name", flat=True) if last_name})
|
||||
if surnames:
|
||||
return _("%(surnames)s family") % {"surnames": " / ".join(surnames)}
|
||||
return _("%(surnames)s") % {"surnames": " / ".join(surnames)}
|
||||
return _("Family %(id)s") % {"id": str(self.pk)[:8]}
|
||||
|
||||
@property
|
||||
|
||||
@@ -87,7 +87,7 @@ class FamilyNameOptionalTests(TestCase):
|
||||
FamilyMembership.objects.create(family=family, member=jones, role=FamilyMembership.FamilyRole.CHILD)
|
||||
|
||||
# Distinct surnames, alphabetically ordered.
|
||||
self.assertEqual(str(family), "Jones / Smith family")
|
||||
self.assertEqual(str(family), "Jones / Smith")
|
||||
|
||||
def test_str_falls_back_to_short_id_when_empty(self):
|
||||
family = Family.objects.create()
|
||||
|
||||
Reference in New Issue
Block a user