diff --git a/src/collective/contact/core/content/position.py b/src/collective/contact/core/content/position.py index bc3cbc7..e496bb9 100644 --- a/src/collective/contact/core/content/position.py +++ b/src/collective/contact/core/content/position.py @@ -69,10 +69,18 @@ class Position(Container): def get_full_title(self): """Returns the full title of the position - It is constituted by the name of the position and - the name of its organization in brackets + It is constituted by the name of the position, + the name of its organization and the name of the + root organization in brackets. """ - return u"%s (%s)" % (self.title, self.get_organization().title) + organization = self.get_organization() + root_organization = organization.get_root_organization() + if organization == root_organization: + return u"%s (%s)" % (self.title, organization.title) + else: + return u"%s, %s (%s)" % (self.title, organization.title, + root_organization.title) + def get_held_positions(self): """Returns the held position diff --git a/src/collective/contact/core/tests/test_content_types.py b/src/collective/contact/core/tests/test_content_types.py index 1bb8eb0..0aa3071 100644 --- a/src/collective/contact/core/tests/test_content_types.py +++ b/src/collective/contact/core/tests/test_content_types.py @@ -159,7 +159,7 @@ class TestPosition(TestContentTypes): self.assertEqual(self.general_adt.get_full_title(), u"Général de l'armée de terre (Armée de terre)") self.assertEqual(self.sergent_lh.get_full_title(), - u"Sergent de la brigade LH (Brigade LH)") + u"Sergent de la brigade LH, Brigade LH (Armée de terre)") class TestHeldPosition(TestContentTypes):