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

Add new attechment functionality to new models

- Giving the ol' refactor tractor a fresh coat of paint
This commit is contained in:
Oliver Walters
2020-05-12 21:40:42 +10:00
parent 2369b40bbf
commit 366d4b2143
10 changed files with 70 additions and 46 deletions

View File

@@ -74,6 +74,11 @@ class PartAttachmentCreate(AjaxCreateView):
ajax_form_title = _("Add part attachment")
ajax_template_name = "modal_form.html"
def post_save(self):
""" Record the user that uploaded the attachment """
self.object.user = self.request.user
self.object.save()
def get_data(self):
return {
'success': _('Added attachment')