Save the current user when creating a new part

This commit is contained in:
Oliver Walters 2020-03-18 21:53:02 +11:00
parent 8186e4bab0
commit a147ce4284

View File

@ -366,7 +366,10 @@ class PartDuplicate(AjaxCreateView):
if valid: if valid:
# Create the new Part # Create the new Part
part = form.save() part = form.save(commit=False)
part.creation_user = request.user
part.save()
data['pk'] = part.pk data['pk'] = part.pk
data['text'] = str(part) data['text'] = str(part)
@ -488,7 +491,12 @@ class PartCreate(AjaxCreateView):
if valid: if valid:
# Create the new Part # 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['pk'] = part.pk
data['text'] = str(part) data['text'] = str(part)