mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Add new global setting to control auto-upload of test reports (#3137)
* Add new global setting to control auto-upload of test reports * Adds callback to attach a copy of the test report when printing * Fix for all attachment API endpoints - The AttachmentMixin must come first! - User was not being set, as the custom 'perform_create' function was never called * Remove duplicated UserSerializer * display uploading user in attachment table * Add unit test to check the test report is automatically uploaded
This commit is contained in:
		@@ -302,7 +302,7 @@ class PartInternalPriceList(generics.ListCreateAPIView):
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PartAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
 | 
			
		||||
class PartAttachmentList(AttachmentMixin, generics.ListCreateAPIView):
 | 
			
		||||
    """API endpoint for listing (and creating) a PartAttachment (file upload)."""
 | 
			
		||||
 | 
			
		||||
    queryset = PartAttachment.objects.all()
 | 
			
		||||
@@ -317,7 +317,7 @@ class PartAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PartAttachmentDetail(generics.RetrieveUpdateDestroyAPIView, AttachmentMixin):
 | 
			
		||||
class PartAttachmentDetail(AttachmentMixin, generics.RetrieveUpdateDestroyAPIView):
 | 
			
		||||
    """Detail endpoint for PartAttachment model."""
 | 
			
		||||
 | 
			
		||||
    queryset = PartAttachment.objects.all()
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,8 @@ class PartAttachmentSerializer(InvenTreeAttachmentSerializer):
 | 
			
		||||
            'link',
 | 
			
		||||
            'comment',
 | 
			
		||||
            'upload_date',
 | 
			
		||||
            'user',
 | 
			
		||||
            'user_detail',
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
        read_only_fields = [
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user