I'm using Django 2.0.3 on Ubuntu 16.04. Any idea what would cause a model 
formset to return None when calling save()? Here is the relevant code:

RepairFormSet = modelformset_factory(Repair, form=RepairForm, exclude=[])

form = RepairFormSet(request.POST)

if form.is_valid():
  form.save()
  return render(request, 'message-loggedin', {
    'title': 'Success',
    'message': 'A repair request has been made successfully.'
  })
else:
  return render(request, 'message-loggedin', {
    'title': 'Error',
    'message': format_html(str(form.errors))
  })


I checked the database and nothing is added to it, form.save() just always 
returns None. When I try to debug within django/forms/models.py it seems that 
form.has_changed() always returns False, causing nothing to be saved. However I 
do not understand why it thinks nothing has been changed. Any help would be 
greatly appreciated.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/af2d13dd-eb74-44de-bf85-e5d71f1c0f93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to