pass the request user to the ComputerUpdateForm
This commit is contained in:
parent
c9e5963c07
commit
f10e4f7800
|
@ -110,4 +110,12 @@ class ComputerCreateFromCustomerView(LoginRequiredMixin, CreateView):
|
|||
class ComputerUpdateView(LoginRequiredMixin, UpdateView):
|
||||
model = Computer
|
||||
form_class = ComputerUpdateForm
|
||||
template_name = 'computers/computer_update.html'
|
||||
template_name = 'computers/computer_update.html'
|
||||
|
||||
def get_form_kwargs(self):
|
||||
"""
|
||||
Pass the request user to the form.
|
||||
"""
|
||||
kwargs = super(ComputerUpdateView, self).get_form_kwargs()
|
||||
kwargs.update({'user': self.request.user})
|
||||
return kwargs
|
Loading…
Reference in New Issue