From: Marek Stępniowski Date: Fri, 22 Aug 2008 15:07:45 +0000 (+0200) Subject: Fixed searching for books. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/03b16118bd180d3c09452174fd2d4546945d0c48?hp=65904b8667ff6f61bba5282f83ab8fdebb9af509 Fixed searching for books. --- diff --git a/catalogue/views.py b/catalogue/views.py index 0166133a7..ed0436e64 100644 --- a/catalogue/views.py +++ b/catalogue/views.py @@ -39,6 +39,7 @@ def search(request): 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: