X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/99f6dd4f1ff0390de9a9bbd4e3352b953cb9a235..e086b48a37bcbcc7d19890b5954ec93213440b32:/apps/social/utils.py?ds=inline diff --git a/apps/social/utils.py b/apps/social/utils.py index 43bc02905..c6a93537b 100755 --- a/apps/social/utils.py +++ b/apps/social/utils.py @@ -37,11 +37,9 @@ def set_sets(user, work, sets): touch_tag(shelf) # delete empty tags - Tag.objects.filter(category='set', user=user, book_count=0).delete() + Tag.objects.filter(category='set', user=user, items=None).delete() def cites_for_tags(tags): """Returns a QuerySet with all Cites for books with given tags.""" - books = Book.tagged.with_all(tags).order_by().values_list('id', flat=True) - books = list(books) - return Cite.objects.filter(book__id__in=books) + return Cite.objects.filter(book__in=Book.tagged.with_all(tags))