title: Why is form_valid() being executed twice?
body: <p>I am trying to show a Bootstrap Form Modal instead of the usual form in Django. I have written the following code. However, the form_valid() method executes twice when the modal is submitted, thus adding the data twice in the database. Any help would be appreciated.</p>
  
  <pre><code>    form_class = CreateTransacionForm
      template_name = 'create.html'
      success_url = '/main/'
      success_message = 'Transaction created'
  
      def form_valid(self, form):
          obj = form.save(commit=False)
          ## Do some additional tasks
          obj.save()
          return HttpResponseRedirect(reverse('main'))
  </code></pre>
  
  <p>The request looks like <a href="https://i.stack.imgur.com/Ozshs.jpg" rel="nofollow noreferrer">this</a></p>