1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from datetime import datetime
6 from celery.task import task
7 import catalogue.models
8 from traceback import print_exc
13 'book_count': tag.get_count(),
14 'changed_at': datetime.now(),
17 type(tag).objects.filter(pk=tag.pk).update(**update_dict)
21 def index_book(book_id, book_info=None):
23 return catalogue.models.Book.objects.get(id=book_id).search_index(book_info)
25 print "Exception during index: %s" % e