mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Fix consumption template empty field checking
This commit is contained in:
		@@ -1175,11 +1175,23 @@ class ConsumptionTemplateSerializer(serializers.ModelSerializer):
 | 
			
		||||
            attrs["sources"] = {DocumentSource.MailFetch.value}
 | 
			
		||||
 | 
			
		||||
        # Empty strings treated as None to avoid unexpected behavior
 | 
			
		||||
        if ("assign_title") in attrs and len(attrs["assign_title"]) == 0:
 | 
			
		||||
        if (
 | 
			
		||||
            "assign_title" in attrs
 | 
			
		||||
            and attrs["assign_title"] is not None
 | 
			
		||||
            and len(attrs["assign_title"]) == 0
 | 
			
		||||
        ):
 | 
			
		||||
            attrs["assign_title"] = None
 | 
			
		||||
        if "filter_filename" in attrs and len(attrs["filter_filename"]) == 0:
 | 
			
		||||
        if (
 | 
			
		||||
            "filter_filename" in attrs
 | 
			
		||||
            and attrs["filter_filename"] is not None
 | 
			
		||||
            and len(attrs["filter_filename"]) == 0
 | 
			
		||||
        ):
 | 
			
		||||
            attrs["filter_filename"] = None
 | 
			
		||||
        if "filter_path" in attrs and len(attrs["filter_path"]) == 0:
 | 
			
		||||
        if (
 | 
			
		||||
            "filter_path" in attrs
 | 
			
		||||
            and attrs["filter_path"] is not None
 | 
			
		||||
            and len(attrs["filter_path"]) == 0
 | 
			
		||||
        ):
 | 
			
		||||
            attrs["filter_path"] = None
 | 
			
		||||
 | 
			
		||||
        if (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user