From 55ac98ebe1b1898583309434475c25a73815066b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 15 Oct 2022 19:33:30 +0300 Subject: [PATCH] Add survex trips to logbook mentions --- core/views/logbooks.py | 6 ++++-- templates/person.html | 28 ++++++++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/core/views/logbooks.py b/core/views/logbooks.py index f26a850..625575f 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -139,11 +139,13 @@ class Expeditions_jsonListView(ListView): def person(request, first_name='', last_name='', ): try: this_person = Person.objects.get(first_name = first_name, last_name = last_name) - return render(request,'person.html', {'person': this_person, }) except: message = f'Person not found \'{first_name} {last_name}\' - possibly Scottish? (See our Proposal to fix this)' - return render(request, 'errors/generic.html', {'message': message}) + return render(request, 'errors/generic.html', {'message': message}) + + return render(request,'person.html', {'person': this_person }) + def get_person_chronology(personexpedition): diff --git a/templates/person.html b/templates/person.html index 1216c60..d88b91b 100644 --- a/templates/person.html +++ b/templates/person.html @@ -16,17 +16,25 @@

{{person|safe}} has been on expo in the following years:

-

-

-

+ + +{% for personexpedition in person.personexpedition_set.all %} + + + + + + +{% endfor %} +
ExpoLogbook mentionsSurvex trips
{{personexpedition.expedition.year}} + +   + {{personexpedition.persontrip_set.all|length}} + +   + {{personexpedition.survexpersonrole_set.all|length}} +

Surveys done

Wallets and surveys mentioning {{person}}