better index

This commit is contained in:
radex 2020-05-11 21:25:35 +02:00 committed by Piotr Dobrowolski
parent 1587f26181
commit d313274615
1 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,9 @@ def apply_smart_search(query, objects):
def index(request): def index(request):
return render(request, 'index.html') return render(request, 'results.html', {
'results': Item.get_roots()
})
def search(request): def search(request):
@ -75,9 +77,7 @@ def search(request):
def item_display(request, pk): def item_display(request, pk):
if not pk: if not pk:
return render(request, 'results.html', { return index(request)
'results': Item.get_roots()
})
item = get_object_or_404(Item, pk=pk) item = get_object_or_404(Item, pk=pk)
labels = item.labels.all() labels = item.labels.all()