mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-23 09:35:30 +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:
@@ -1043,7 +1043,7 @@ class StockList(APIDownloadMixin, generics.ListCreateAPIView):
|
||||
]
|
||||
|
||||
|
||||
class StockAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
|
||||
class StockAttachmentList(AttachmentMixin, generics.ListCreateAPIView):
|
||||
"""API endpoint for listing (and creating) a StockItemAttachment (file upload)."""
|
||||
|
||||
queryset = StockItemAttachment.objects.all()
|
||||
@@ -1060,7 +1060,7 @@ class StockAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
|
||||
]
|
||||
|
||||
|
||||
class StockAttachmentDetail(generics.RetrieveUpdateDestroyAPIView, AttachmentMixin):
|
||||
class StockAttachmentDetail(AttachmentMixin, generics.RetrieveUpdateDestroyAPIView):
|
||||
"""Detail endpoint for StockItemAttachment."""
|
||||
|
||||
queryset = StockItemAttachment.objects.all()
|
||||
|
||||
Reference in New Issue
Block a user