title: Does form_valid on a CreateView in django roll back a save if an error occurs?
body: <p>I have a CreateView for a ModelForm with a form_valid() method, which calls form.save() quite early on (so that I can get the object's ID), then goes on to do some other stuff (create some related objects, and send some emails). </p>
  
  <pre><code>def form_valid(self, form):
      context = self.get_context_data()
      preferences_formset = context['preferences_formset']
      if preferences_formset.is_valid():
          student = form.save()
          ...
          send_email_one()
          send_email_two()
          send_email_three()
          return HttpResponseRedirect(self.get_success_url())
  </code></pre>
  
  <p>I recently discovered that some of the later processing had some errors resulting in an unhandled exception in some cases when send_email_three is called. I can see from my logs that send_email_one and send_email_two are being called, and the exception occurs in send_email_three. However, when this has occurred, I can't find the objects in the DB. I was under the impression that form.save() should create and save the object in the DB - is this the case or does it roll back the save if the form_valid function errors out at a later point?</p>
  
  <p>I'm using django 1.8.17</p>
  
  <p>PS: Yes, I know I should have the emails in a deferred task; that will be implemented later. </p>