2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 12:51:11 +00:00

stumbled on bug when no entries in logbook, fixed.

This commit is contained in:
2025-01-15 20:21:49 +00:00
parent f3bd9024cf
commit c5b08ce80f
2 changed files with 47 additions and 32 deletions

View File

@@ -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: