mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	document list validation.
This commit is contained in:
		| @@ -185,6 +185,13 @@ class BulkEditSerializer(serializers.Serializer): | |||||||
|  |  | ||||||
|     parameters = serializers.DictField(allow_empty=True) |     parameters = serializers.DictField(allow_empty=True) | ||||||
|  |  | ||||||
|  |     def validate_documents(self, documents): | ||||||
|  |         count = Document.objects.filter(id__in=documents).count() | ||||||
|  |         if not count == len(documents): | ||||||
|  |             raise serializers.ValidationError( | ||||||
|  |                 "Some documents don't exist or were specified twice.") | ||||||
|  |         return documents | ||||||
|  |  | ||||||
|     def validate_method(self, method): |     def validate_method(self, method): | ||||||
|         if method == "set_correspondent": |         if method == "set_correspondent": | ||||||
|             return bulk_edit.set_correspondent |             return bulk_edit.set_correspondent | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler