Merge pull request #476 from rachmadaniHaryono/bugfix/bukuserver-page

fix: dev: index error on bookmark
This commit is contained in:
Mischievous Meerkat 2020-10-16 17:30:16 +05:30 committed by GitHub
commit 35aa009bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,7 +219,10 @@ class BookmarkModelView(BaseModelView):
bookmarks = sorted(bookmarks, key=lambda x: x[key_idx], reverse=sort_desc)
count = len(bookmarks)
if page_size and bookmarks:
try:
bookmarks = list(chunks(bookmarks, page_size))[page]
except IndexError:
bookmarks = []
data = []
for bookmark in bookmarks:
bm_sns = SimpleNamespace(id=None, url=None, title=None, tags=None, description=None)