summaryrefslogtreecommitdiffstats
path: root/expo/views_logbooks.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-06-12 05:39:30 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-06-12 05:39:30 +0100
commit5db52862f6d2ebcc3c3878f2442f68e3d4372d72 (patch)
tree34ae0cf6242f101e4cbfe06d66b2a18b7fa4f657 /expo/views_logbooks.py
parent0ed153f2d0fd38dfe94a686621a0e70922233920 (diff)
downloadtroggle-5db52862f6d2ebcc3c3878f2442f68e3d4372d72.tar.gz
troggle-5db52862f6d2ebcc3c3878f2442f68e3d4372d72.tar.bz2
troggle-5db52862f6d2ebcc3c3878f2442f68e3d4372d72.zip
[svn] * Fix bugs that were causing broken wikilinks. *Add edit link to mugshots. *make admin url trailing-slash tolerant
Diffstat (limited to 'expo/views_logbooks.py')
-rw-r--r--expo/views_logbooks.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/expo/views_logbooks.py b/expo/views_logbooks.py
index cfebd35..afcdafc 100644
--- a/expo/views_logbooks.py
+++ b/expo/views_logbooks.py
@@ -98,9 +98,13 @@ def newQMlink(logbookentry):
return settings.URL_ROOT + r'/admin/expo/qm/add/?' + r'found_by=' + str(logbookentry.pk) +'&number=' + str(nextQMnumber)
def logbookentry(request, date, slug):
- logbookentry = LogbookEntry.objects.get(date=date, slug=slug)
-
- return render_response(request, 'logbookentry.html', {'logbookentry': logbookentry, 'newQMlink':newQMlink(logbookentry)})
+ logbookentry = LogbookEntry.objects.filter(date=date, slug=slug)
+
+ if len(logbookentry)>1:
+ return render_response(request, 'object_list.html',{'object_list':logbookentry})
+ else:
+ logbookentry=logbookentry[0]
+ return render_response(request, 'logbookentry.html', {'logbookentry': logbookentry, 'newQMlink':newQMlink(logbookentry)})
def logbookSearch(request, extra):
query_string = ''