From b6b5313f2d97210f325c6f973cd9ee710021043f Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sat, 9 Sep 2017 14:23:25 +0200 Subject: [PATCH] Fix for #315 --- cps/web.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cps/web.py b/cps/web.py index 4040df1c..1437743b 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1084,12 +1084,9 @@ def hot_books(page): hot_books = all_books.offset(off).limit(config.config_books_per_page) entries = list() for book in hot_books: - downloadBook = db.session.query(db.Books).filter(db.Books.id == book.Downloads.book_id).first() + downloadBook = db.session.query(db.Books).filter(common_filters()).filter(db.Books.id == book.Downloads.book_id).first() if downloadBook: - entries.append( - db.session.query(db.Books).filter(common_filters()) - .filter(db.Books.id == book.Downloads.book_id).first() - ) + entries.append(downloadBook) else: ub.session.query(ub.Downloads).filter(book.Downloads.book_id == ub.Downloads.book_id).delete() ub.session.commit()