From 918a04c5022865bda795c46553bb783733b4b640 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 18 May 2023 17:01:07 +0700 Subject: [PATCH] allow empty data for paginate --- tubearchivist/home/src/es/connect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubearchivist/home/src/es/connect.py b/tubearchivist/home/src/es/connect.py index 5af1838d..134472c7 100644 --- a/tubearchivist/home/src/es/connect.py +++ b/tubearchivist/home/src/es/connect.py @@ -127,6 +127,9 @@ class IndexPaginate: def validate_data(self): """add pit and size to data""" + if not self.data: + self.data = {} + if "sort" not in self.data.keys(): self.data.update({"sort": [{"_doc": {"order": "desc"}}]})