summaryrefslogtreecommitdiffstats
path: root/core/views/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-01-29 01:30:10 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-01-29 01:30:10 +0000
commit071f68080c4e46049b89b4d78f635512df8d411b (patch)
tree2c712fb8165d451761be3827b48b8044f0a7ee8d /core/views/logbooks.py
parent03fa5f554808133b05c1bbbbd6f1392f32489ee7 (diff)
downloadtroggle-071f68080c4e46049b89b4d78f635512df8d411b.tar.gz
troggle-071f68080c4e46049b89b4d78f635512df8d411b.tar.bz2
troggle-071f68080c4e46049b89b4d78f635512df8d411b.zip
Inherit *team to anonymous survex blocks
Diffstat (limited to 'core/views/logbooks.py')
-rw-r--r--core/views/logbooks.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py
index 9748aed..ece3f98 100644
--- a/core/views/logbooks.py
+++ b/core/views/logbooks.py
@@ -148,9 +148,7 @@ def person(request, first_name='', last_name='', ):
def get_person_chronology(personexpedition):
- '''Horrible bug here when there is more than one survex block per day, it duplicates the entry but gets it wrong
- Fortunately this is just the display on this page which is wroing, no bad calculations get into the database.
-
+ '''
This is just a nasty convoluted way of trying the make the template do more work than it is sensible to ask it to do.
Rewrite more simply with the login in the python, not in Django template language (you bastard Curtis).
'''
@@ -160,8 +158,9 @@ def get_person_chronology(personexpedition):
a.setdefault("persontrips", [ ]).append(persontrip)
for personrole in personexpedition.survexpersonrole_set.all():
- a = res.setdefault(personrole.survexblock.date, { })
- a.setdefault("personroles", [ ]).append(personrole.survexblock)
+ if personrole.survexblock.date: # avoid bad data from another bug
+ a = res.setdefault(personrole.survexblock.date, { })
+ a.setdefault("personroles", [ ]).append(personrole.survexblock)
# build up the tables
rdates = sorted(list(res.keys()))