I found an error with the pagination functionality.
Suppose the documents per page is 25 and the page contains 11 documents, the pagination button gives me a wrong message (page 1 of 1.44) and it shows the Next button and it lets to click the button.
Ideally it should not show the Next button if the count is less than 25. It redirects to an error page when I click the Next button. It was a TypeError at /mongonaut/... (integer argument expected, got float).
I found that the error is getting when you calculate total pages.
self.total_pages = obj_count / self.documents_per_page + (1 if obj_count % self.documents_per_page else 0)
ie, self.total_pages = 11/25+0
this results a float no(1.44). so the total pages will be more than 1 and it shows the next button
So I did a small correction in the same line
self.total_pages = int(obj_count / self.documents_per_page + (1 if obj_count % self.documents_per_page else 0))
Hi
I found an error with the pagination functionality.
Suppose the documents per page is 25 and the page contains 11 documents, the pagination button gives me a wrong message (page 1 of 1.44) and it shows the Next button and it lets to click the button. Ideally it should not show the Next button if the count is less than 25. It redirects to an error page when I click the Next button. It was a TypeError at /mongonaut/... (integer argument expected, got float).
I found that the error is getting when you calculate total pages. self.total_pages = obj_count / self.documents_per_page + (1 if obj_count % self.documents_per_page else 0) ie, self.total_pages = 11/25+0
this results a float no(1.44). so the total pages will be more than 1 and it shows the next button
So I did a small correction in the same line self.total_pages = int(obj_count / self.documents_per_page + (1 if obj_count % self.documents_per_page else 0))
it works fine with this code
Thank you