diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/models/logbooks.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/models/logbooks.py b/core/models/logbooks.py index 8c8edbc..fd6bbfe 100644 --- a/core/models/logbooks.py +++ b/core/models/logbooks.py @@ -57,14 +57,16 @@ class LogbookEntry(TroggleModel): <div class="trippeople">{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}<u>{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %}</u>,{% endif %}{% endfor %}{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}{% else %}{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %},{% endif %}{% endfor %}{% if logbook_entry.other_people %}, {{logbook_entry.other_people}}{% endif %}</div> ''' - author = ( + if author := ( PersonLogEntry.objects.filter(logbook_entry=self, is_logbook_entry_author=True) .first() - ) - if author.nickname_used: - expoer = author.nickname_used + ): + if author.nickname_used: + expoer = author.nickname_used + else: + expoer = author.personexpedition.person.name() else: - expoer = author.personexpedition.person.name() + expoer = "nobody" names = f"<u>{expoer}</u>" participants = ( @@ -119,7 +121,7 @@ def writelogbook(year, filename): t = loader.get_template("logbook2005style.html") logbookfile = t.render({"logbook_entries": logbook_entries}) except: - print(" ! Very Bad Error RENDERING template " + template) + print(" ! Very Bad Error RENDERING template ", t) raise # print(" - template rendered") try: |