2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Update calls to post_save

This commit is contained in:
Oliver Walters
2020-10-30 10:12:42 +11:00
parent 2d583d19c2
commit 5c5641d884
2 changed files with 16 additions and 16 deletions

View File

@ -164,11 +164,11 @@ class StockItemAttachmentCreate(AjaxCreateView):
ajax_template_name = "modal_form.html"
role_required = 'stock.add'
def post_save(self, **kwargs):
def post_save(self, attachment, form, **kwargs):
""" Record the user that uploaded the attachment """
self.object.user = self.request.user
self.object.save()
attachment.user = self.request.user
attachment.save()
def get_data(self):
return {
@ -440,11 +440,11 @@ class StockItemTestResultCreate(AjaxCreateView):
ajax_form_title = _("Add Test Result")
role_required = 'stock.add'
def post_save(self, **kwargs):
def post_save(self, result, form, **kwargs):
""" Record the user that uploaded the test result """
self.object.user = self.request.user
self.object.save()
result.user = self.request.user
result.save()
def get_initial(self):