Skip to content

ZeroDivisionError: integer division or modulo by zero on filtered or empty table when selecting page #35

@oshawa-connection

Description

@oshawa-connection

Buongiorno,

We're having some problems with the server side of this library. The problem occurs when selecting " show all entries" when the table is filtered or there are no records in the table; see below.
image

The minimum reproducible example app:
https://github.com/oshawa-connection/django-ajax-datatable-min-example

The error in full:

ZeroDivisionError at /ajax_datatable/permissions/

integer division or modulo by zero
Request Method: POST
http://127.0.0.1:8000/ajax_datatable/permissions/
3.2.5
ZeroDivisionError
integer division or modulo by zero
C:\Python39\lib\site-packages\ajax_datatable\views.py, line 689, in get_response_dict
C:\Python39\python.exe
3.9.5
['C:\Users\fleminjw\Documents\temp\django\mysite', 'C:\Python39\python39.zip', 'C:\Python39\DLLs', 'C:\Python39\lib', 'C:\Python39', 'C:\Users\fleminjw\AppData\Roaming\Python\Python39\site-packages', 'C:\Python39\lib\site-packages', 'C:\Python39\lib\site-packages\win32', 'C:\Python39\lib\site-packages\win32\lib', 'C:\Python39\lib\site-packages\Pythonwin']
Wed, 28 Jul 2021 07:50:28 +0000

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.

We are happy to provide a PR for this issue if necessary.
Django==3.2.5
django-ajax-datatable==4.2.1

Cordiali saluti

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions