Skip to content

Commit

Permalink
display several civilian identities, if linked
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenGCD committed Feb 6, 2025
1 parent 60e1ee8 commit 1f82bc8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/gcd/models/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def get_civilian_identity(character, appearing_characters, url=True,
'character__character', flat=True))
if civilian_identity:
civilian_identity = appearing_characters.filter(
character__character__id=civilian_identity.pop())
character__character__id__in=civilian_identity)
characters = ' ['
several = False
compare_characters = ''
for identity in civilian_identity:
if several:
characters += '; '
Expand All @@ -134,9 +135,14 @@ def get_civilian_identity(character, appearing_characters, url=True,
else:
characters += '%s' % identity.character.name
if compare:
return ' [%s]' % identity.character.character.disambiguated
if several:
compare_characters += '; '
compare_characters += ' [%s' % identity.character.character\
.disambiguated
several = True
characters += ']'
if compare:
return compare_characters + ']'
return characters
else:
return ''
Expand Down

0 comments on commit 1f82bc8

Please sign in to comment.