mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fix pycodestyle
This commit is contained in:
		| @@ -85,9 +85,9 @@ def modify_tags(doc_ids, add_tags, remove_tags): | |||||||
|         tag_id__in=remove_tags, |         tag_id__in=remove_tags, | ||||||
|     ).delete() |     ).delete() | ||||||
|  |  | ||||||
|     DocumentTagRelationship.objects.bulk_create([ |     DocumentTagRelationship.objects.bulk_create([DocumentTagRelationship( | ||||||
|         DocumentTagRelationship( |         document_id=doc, tag_id=tag) for (doc, tag) in itertools.product( | ||||||
|             document_id=doc, tag_id=tag) for (doc,tag) in itertools.product(affected_docs, add_tags) |         affected_docs, add_tags) | ||||||
|     ], ignore_conflicts=True) |     ], ignore_conflicts=True) | ||||||
|  |  | ||||||
|     async_task( |     async_task( | ||||||
|   | |||||||
| @@ -230,17 +230,20 @@ class BulkEditSerializer(serializers.Serializer): | |||||||
|         if not type(documents) == list: |         if not type(documents) == list: | ||||||
|             raise serializers.ValidationError(f"{name} must be a list") |             raise serializers.ValidationError(f"{name} must be a list") | ||||||
|         if not all([type(i) == int for i in documents]): |         if not all([type(i) == int for i in documents]): | ||||||
|             raise serializers.ValidationError(f"{name} must be a list of integers") |             raise serializers.ValidationError( | ||||||
|  |                 f"{name} must be a list of integers") | ||||||
|         count = Document.objects.filter(id__in=documents).count() |         count = Document.objects.filter(id__in=documents).count() | ||||||
|         if not count == len(documents): |         if not count == len(documents): | ||||||
|             raise serializers.ValidationError( |             raise serializers.ValidationError( | ||||||
|                 f"Some documents in {name} don't exist or were specified twice.") |                 f"Some documents in {name} don't exist or were " | ||||||
|  |                 f"specified twice.") | ||||||
|  |  | ||||||
|     def _validate_tag_id_list(self, tags, name="tags"): |     def _validate_tag_id_list(self, tags, name="tags"): | ||||||
|         if not type(tags) == list: |         if not type(tags) == list: | ||||||
|             raise serializers.ValidationError(f"{name} must be a list") |             raise serializers.ValidationError(f"{name} must be a list") | ||||||
|         if not all([type(i) == int for i in tags]): |         if not all([type(i) == int for i in tags]): | ||||||
|             raise serializers.ValidationError(f"{name} must be a list of integers") |             raise serializers.ValidationError( | ||||||
|  |                 f"{name} must be a list of integers") | ||||||
|         count = Tag.objects.filter(id__in=tags).count() |         count = Tag.objects.filter(id__in=tags).count() | ||||||
|         if not count == len(tags): |         if not count == len(tags): | ||||||
|             raise serializers.ValidationError( |             raise serializers.ValidationError( | ||||||
| @@ -310,7 +313,8 @@ class BulkEditSerializer(serializers.Serializer): | |||||||
|             raise serializers.ValidationError("add_tags not specified") |             raise serializers.ValidationError("add_tags not specified") | ||||||
|  |  | ||||||
|         if "remove_tags" in parameters: |         if "remove_tags" in parameters: | ||||||
|             self._validate_tag_id_list(parameters['remove_tags'], "remove_tags") |             self._validate_tag_id_list(parameters['remove_tags'], | ||||||
|  |                                        "remove_tags") | ||||||
|         else: |         else: | ||||||
|             raise serializers.ValidationError("remove_tags not specified") |             raise serializers.ValidationError("remove_tags not specified") | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler