mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Save the current user when creating a new part
This commit is contained in:
parent
8186e4bab0
commit
a147ce4284
@ -366,7 +366,10 @@ class PartDuplicate(AjaxCreateView):
|
||||
|
||||
if valid:
|
||||
# Create the new Part
|
||||
part = form.save()
|
||||
part = form.save(commit=False)
|
||||
|
||||
part.creation_user = request.user
|
||||
part.save()
|
||||
|
||||
data['pk'] = part.pk
|
||||
data['text'] = str(part)
|
||||
@ -488,7 +491,12 @@ class PartCreate(AjaxCreateView):
|
||||
|
||||
if valid:
|
||||
# Create the new Part
|
||||
part = form.save()
|
||||
part = form.save(commit=False)
|
||||
|
||||
# Record the user who created this part
|
||||
part.creation_user = request.user
|
||||
|
||||
part.save()
|
||||
|
||||
data['pk'] = part.pk
|
||||
data['text'] = str(part)
|
||||
|
Loading…
Reference in New Issue
Block a user