Added new staticmethod from_xml_file to Book model and reimplemented importbooks...
[wolnelektury.git] / catalogue / views.py
index 0166133..49f4196 100644 (file)
@@ -36,9 +36,9 @@ def search(request):
         tag_list = models.Tag.get_tag_list(tags)
         tag = models.Tag.objects.get(name=query)
     except models.Tag.DoesNotExist:
-        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: