                      return min(self.max_paginate_by, paginate_by_param)
                  else:
                      return paginate_by_param
  
          if self.max_paginate_by:
              return min(self.max_paginate_by, self.paginate_by)
          else:
              return self.paginate_by
  
      def get_serializer_class(self):
          """
          Return the class to use for the serializer.
          Defaults to using `self.serializer_class`.
 
</s> remove             else:
                if self.max_paginate_by is not None:
                    return min(self.max_paginate_by, paginate_by_param)
                else:
                    return paginate_by_param
 </s> add  </s> remove                 paginate_by_param = int(query_params[self.paginate_by_param])
 </s> add                 return strict_positive_int(
                    self.request.QUERY_PARAMS[self.paginate_by_param],
                    cutoff=self.max_paginate_by
                ) </s> remove             query_params = self.request.QUERY_PARAMS
 </s> add  </s> remove def strict_positive_int(integer_string):
 </s> add def strict_positive_int(integer_string, cutoff=None):
        return self.paginate_by
                      return min(self.max_paginate_by, paginate_by_param)
                  else:
                      return paginate_by_param
  
        return self.paginate_by
        return self.paginate_by
        return self.paginate_by
        return self.paginate_by
  
      def get_serializer_class(self):
          """
          Return the class to use for the serializer.
          Defaults to using `self.serializer_class`.
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Tweak MAX_PAGINATE_BY behavior in edge case.

Always respect `paginate_by` settings if client does not specify page
size.  (Even if the developer has misconfigured, so that `paginate_by >
max`.) 
rest_framework/generics.py