Fixed searching for books.
authorMarek Stępniowski <marek@stepniowski.com>
Fri, 22 Aug 2008 15:07:45 +0000 (17:07 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Fri, 22 Aug 2008 15:07:45 +0000 (17:07 +0200)
catalogue/views.py

index 0166133..ed0436e 100644 (file)
@@ -39,6 +39,7 @@ def search(request):
         print "%r, %r" % (query, tags)
         try:
             book = models.Book.objects.get(title=query)
         print "%r, %r" % (query, tags)
         try:
             book = models.Book.objects.get(title=query)
+            return HttpResponseRedirect(book.get_absolute_url())
         except models.Book.DoesNotExist:
             return HttpResponseRedirect(reverse('catalogue.views.main_page'))
     else:
         except models.Book.DoesNotExist:
             return HttpResponseRedirect(reverse('catalogue.views.main_page'))
     else: