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
commit9b44731c338a14e45b9a6f757cdaec8bf67db77d (patch)
treefd2bdef20f9db2ac32bab87d73e229ee0f54fab6 /expo/views_logbooks.py
parent5946e159bc7da2ffa757ca528fa1ca6cffa229e1 (diff)
downloadtroggle-9b44731c338a14e45b9a6f757cdaec8bf67db77d.tar.gz
troggle-9b44731c338a14e45b9a6f757cdaec8bf67db77d.tar.bz2
troggle-9b44731c338a14e45b9a6f757cdaec8bf67db77d.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 = ''