mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	pycodestyle
This commit is contained in:
		| @@ -332,15 +332,15 @@ class SearchResultSerializer(DocumentSerializer): | |||||||
|  |  | ||||||
|     def to_representation(self, instance): |     def to_representation(self, instance): | ||||||
|         doc = Document.objects.get(id=instance['id']) |         doc = Document.objects.get(id=instance['id']) | ||||||
|         representation = super(SearchResultSerializer, self).to_representation(doc) |         r = super(SearchResultSerializer, self).to_representation(doc) | ||||||
|         representation['__search_hit__'] = { |         r['__search_hit__'] = { | ||||||
|             "score": instance.score, |             "score": instance.score, | ||||||
|             "highlights": instance.highlights("content", |             "highlights": instance.highlights("content", | ||||||
|                                    text=doc.content) if doc else None,  # NOQA: E501 |                                    text=doc.content) if doc else None,  # NOQA: E501 | ||||||
|             "rank": instance.rank |             "rank": instance.rank | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         return representation |         return r | ||||||
|  |  | ||||||
|  |  | ||||||
| class UnifiedSearchViewSet(DocumentViewSet): | class UnifiedSearchViewSet(DocumentViewSet): | ||||||
| @@ -356,7 +356,8 @@ class UnifiedSearchViewSet(DocumentViewSet): | |||||||
|             return DocumentSerializer |             return DocumentSerializer | ||||||
|  |  | ||||||
|     def _is_search_request(self): |     def _is_search_request(self): | ||||||
|         return "query" in self.request.query_params or "more_like_id" in self.request.query_params |         return ("query" in self.request.query_params or | ||||||
|  |                 "more_like_id" in self.request.query_params) | ||||||
|  |  | ||||||
|     def filter_queryset(self, queryset): |     def filter_queryset(self, queryset): | ||||||
|         if self._is_search_request(): |         if self._is_search_request(): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler