forked from expo/troggle
more robust logbooks parsing
This commit is contained in:
@@ -176,13 +176,17 @@ def personexpedition(request, first_name='', last_name='', year=''):
|
||||
|
||||
def logbookentry(request, date, slug):
|
||||
this_logbookentry = LogbookEntry.objects.filter(date=date, slug=slug)
|
||||
|
||||
if len(this_logbookentry)>1:
|
||||
return render(request, 'object_list.html',{'object_list':this_logbookentry})
|
||||
|
||||
if this_logbookentry:
|
||||
if len(this_logbookentry)>1:
|
||||
return render(request, 'object_list.html',{'object_list':this_logbookentry})
|
||||
else:
|
||||
this_logbookentry=this_logbookentry[0]
|
||||
return render(request, 'logbookentry.html', {'logbookentry': this_logbookentry})
|
||||
else:
|
||||
this_logbookentry=this_logbookentry[0]
|
||||
return render(request, 'logbookentry.html', {'logbookentry': this_logbookentry})
|
||||
|
||||
msg =(f' Logbook entry slug:"{slug}" not found in database on date:"{date}" ')
|
||||
print(msg)
|
||||
return render(request, 'errors/generic.html',{'message':msg})
|
||||
|
||||
def logbookSearch(request, extra):
|
||||
query_string = ''
|
||||
|
||||
Reference in New Issue
Block a user