From 88eb500c83f059d0b22d3a623624c266c8815c94 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 11 Jun 2023 14:17:29 +1000 Subject: [PATCH] fix bug with series with 0 books in it, not showing up for use when editing a book --- series.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/series.py b/series.py index 974de43..605f916 100644 --- a/series.py +++ b/series.py @@ -49,7 +49,7 @@ def CalcAvgRating(sid): def ListOfSeriesWithMissingBooks(): with db.engine.connect() as conn: - res=conn.exec_driver_sql( "select id, title, num_books, count from ( select s.id, s.title, s.num_books, count(bsl.book_id) from series s, book_series_link bsl where s.id = bsl.series_id group by s.id ) as foo where num_books > count") + res=conn.exec_driver_sql( "select id, title, num_books, count from ( select s.id, s.title, s.num_books, count(bsl.book_id) from series s left outer join book_series_link bsl on bsl.series_id=s.id group by s.id) as foo where num_books > count") tmp=[] for row in res: tmp.append({'id': row[0], 'title': row[1]})