X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/068c98b54439d470e060aa6543e09f31e51d0370..4831dedf044348077af2f8c64c40a78ba1c8f8d5:/catalogue/views.py 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: