-
- # There also shouldn't be pagination if the list is too short. Try count()
- # first - good chance it's a queryset, where count is more efficient.
- try:
- if objects.count() <= per_page:
- paginator = page = None
- except AttributeError:
- if len(objects) <= per_page:
- paginator = page = None
+ else:
+ # There also shouldn't be pagination if the list is too short. Try count()
+ # first - good chance it's a queryset, where count is more efficient.
+ try:
+ if objects.count() <= per_page:
+ paginator = page = None
+ except AttributeError:
+ if len(objects) <= per_page:
+ paginator = page = None