2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 05:55:06 +00:00

chipping away bug in personexpedition, remove role

This commit is contained in:
Philip Sargent
2021-04-30 00:24:36 +01:00
parent e5cf1b5289
commit 03a5f5989e
9 changed files with 82 additions and 34 deletions

View File

@@ -141,8 +141,11 @@ def person(request, first_name='', last_name='', ):
def get_person_chronology(personexpedition):
'''Horrible bug here whern there is more than one survex block per day, it duplicates the entry but gets it wrong
'''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).
'''
res = { }
for persontrip in personexpedition.persontrip_set.all():
@@ -171,6 +174,8 @@ def personexpedition(request, first_name='', last_name='', year=''):
this_expedition = Expedition.objects.get(year=year)
personexpedition = person.personexpedition_set.get(expedition=this_expedition)
personchronology = get_person_chronology(personexpedition)
#for pc in personchronology:
#print(pc)
return render(request,'personexpedition.html', {'personexpedition': personexpedition, 'personchronology':personchronology})