only top level books in api/newest
authorJan Szejko <janek37@gmail.com>
Thu, 29 Mar 2018 12:18:17 +0000 (14:18 +0200)
committerJan Szejko <janek37@gmail.com>
Thu, 29 Mar 2018 12:18:17 +0000 (14:18 +0200)
src/api/handlers.py

index 88fa1c3..3c6761b 100644 (file)
@@ -210,6 +210,8 @@ class AnonymousBooksHandler(AnonymousBaseHandler, BookDetails):
         except ValueError:
             return rc.NOT_FOUND
 
         except ValueError:
             return rc.NOT_FOUND
 
+        top_level = top_level or newest
+
         if 'after' in request.GET:
             after = request.GET['after']
         if 'before' in request.GET:
         if 'after' in request.GET:
             after = request.GET['after']
         if 'before' in request.GET: