mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Ensure user gets saved when uploading attachment via API
This commit is contained in:
@ -663,6 +663,12 @@ class StockAttachmentList(generics.ListCreateAPIView):
|
||||
'stock_item',
|
||||
]
|
||||
|
||||
def perform_create(self, serializer):
|
||||
|
||||
attachment = serializer.save()
|
||||
attachment.user = self.request.user
|
||||
attachment.save()
|
||||
|
||||
|
||||
class StockTrackingList(generics.ListCreateAPIView):
|
||||
""" API endpoint for list view of StockItemTracking objects.
|
||||
|
Reference in New Issue
Block a user