Thank you good sir! You have put an end to my week long head ache!
On Thursday, June 20, 2013 12:27:36 PM UTC-4, Jason Arnst-Goodrich wrote:
>
> This is a common problem to run into.
>
> def form_valid(self, form):
>
> customer = form.save(commit=False)
>
> customer.store =
This is a common problem to run into.
def form_valid(self, form):
customer = form.save(commit=False)
customer.store = self.request.user.active_profile.store
customer.save()
return super(CustomerInformationView, self).save(form)
super(CustomerInformationView, self).save(form)doesn't really
Basically, I have a model, a ModelForm, and an UpdateView. I go to the
UpdateView (viewing a current customer) and just hit the submit button
(changing no data). What results is an error from the model: *Cannot assign
None: "Customer.store" does not allow null values.* (*I do not have a field
3 matches
Mail list logo