mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Merge pull request #4437 from dfavato/master
Set self.count before self.limit in LimitOffsetPagination
This commit is contained in:
		
						commit
						60dbe72a62
					
				| 
						 | 
				
			
			@ -332,12 +332,12 @@ class LimitOffsetPagination(BasePagination):
 | 
			
		|||
    template = 'rest_framework/pagination/numbers.html'
 | 
			
		||||
 | 
			
		||||
    def paginate_queryset(self, queryset, request, view=None):
 | 
			
		||||
        self.count = _get_count(queryset)
 | 
			
		||||
        self.limit = self.get_limit(request)
 | 
			
		||||
        if self.limit is None:
 | 
			
		||||
            return None
 | 
			
		||||
 | 
			
		||||
        self.offset = self.get_offset(request)
 | 
			
		||||
        self.count = _get_count(queryset)
 | 
			
		||||
        self.request = request
 | 
			
		||||
        if self.count > self.limit and self.template is not None:
 | 
			
		||||
            self.display_page_controls = True
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user