summaryrefslogtreecommitdiffstats
path: root/core/views/scans.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-10-01 15:55:28 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-10-01 15:55:28 +0300
commit7b8703dadc654284daea4ec1cb263a3b17b1b041 (patch)
tree6a380e4d12ee39d57ba7b68d5e3d740ba52988d5 /core/views/scans.py
parent16d3ee9f92914859edd7b568c9dbd802fd93438e (diff)
downloadtroggle-7b8703dadc654284daea4ec1cb263a3b17b1b041.tar.gz
troggle-7b8703dadc654284daea4ec1cb263a3b17b1b041.tar.bz2
troggle-7b8703dadc654284daea4ec1cb263a3b17b1b041.zip
part-way though converting to slugs for people
Diffstat (limited to 'core/views/scans.py')
-rw-r--r--core/views/scans.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/core/views/scans.py b/core/views/scans.py
index 8e334bf..7e25862 100644
--- a/core/views/scans.py
+++ b/core/views/scans.py
@@ -142,7 +142,7 @@ def fixsurvextick(w, ticks):
ticks["S"] = w.fixsurvextick(ticks["S"])
-def walletslistperson(request, first_name, last_name):
+def walletslistperson(request, slug):
"""Page which displays a list of all the wallets for a specific person
HORRIBLE linear search through everything. Index and do SQL query properly
"""
@@ -163,20 +163,21 @@ def walletslistperson(request, first_name, last_name):
return manywallets
# print("-walletslistperson")
-
- try:
- if last_name:
- p = Person.objects.get(fullname=f"{first_name} {last_name}")
- else:
- # special Wookey-hack
- p = Person.objects.get(first_name=f"{first_name}")
- except:
- # raise
- return render(
- request,
- "errors/generic.html",
- {"message": f'Unrecognised name of a expo person: "{first_name} {last_name}"'},
- )
+ p = Person.objects.get(slug=slug)
+ # try:
+
+ # if last_name:
+ # p = Person.objects.get(fullname=f"{first_name} {last_name}")
+ # else:
+ # # special Wookey-hack
+ # p = Person.objects.get(first_name=f"{first_name}")
+ # except:
+ # # raise
+ # return render(
+ # request,
+ # "errors/generic.html",
+ # {"message": f'Unrecognised name of a expo person: "{first_name} {last_name}"'},
+ # )
manywallets = tickspersonwallet(p)
expeditions = Expedition.objects.all()