2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 07:40:19 +00:00

fixing ,, bug in logbook rewriting, and fixing persons order

This commit is contained in:
2024-07-30 00:53:24 +03:00
parent 526d0ad904
commit 62320e9f7e
4 changed files with 8 additions and 8 deletions

View File

@@ -76,17 +76,17 @@ class LogbookEntry(TroggleModel):
return index
def writelogbook(year, filename):
"""Writes all the database logbook entries into a new logbook.html file
"""
current_expedition = Expedition.objects.get(year=year)
logbook_entries = LogbookEntry.objects.filter(expedition=current_expedition).order_by(
"slug"
) # now that slug, aka tripid, is in our standard date form, this will preserve ordering.
print(f" - Logbook to be exported has {len(logbook_entries)} entries in it.")
template = "logbook2005style.html"
try:
t = loader.get_template(template)
t = loader.get_template("logbook2005style.html")
logbookfile = t.render({"logbook_entries": logbook_entries})
except:
print(" ! Very Bad Error RENDERING template " + template)