LimitOffsetPagination raises Type error if PAGE_SIZE not set · Issue #2667 · encode/django-rest-framework (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@balsdorf

Description

@balsdorf

In 3.1.0 if you do not have PAGE_SIZE set you get a TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'.

I believe a friendlier message would be useful in this case. I was going to submit a patch but was not sure exactly how you would like to handle this.

Exception Type: TypeError
Exception Value:
unsupported operand type(s) for +: 'int' and 'NoneType'
Exception Location: /work/virtual/skysql_upgrade/local/lib/python2.7/site-packages/rest_framework/pagination.py in paginate_queryset, line 396