mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-05 21:20:56 +00:00
Add 'user' field to attachment
This commit is contained in:
@ -160,6 +160,12 @@ class StockItemAttachmentCreate(AjaxCreateView):
|
||||
ajax_form_title = _("Add Stock Item Attachment")
|
||||
ajax_template_name = "modal_form.html"
|
||||
|
||||
def post_save(self, **kwargs):
|
||||
""" Record the user that uploaded the attachment """
|
||||
|
||||
self.object.user = self.request.user
|
||||
self.object.save()
|
||||
|
||||
def get_data(self):
|
||||
return {
|
||||
'success': _("Added attachment")
|
||||
|
Reference in New Issue
Block a user