title: Django save() method not saving
body: <p>I am using a signal to update fields in the profile table when a new investment is made. </p>
  
  <p>Having used a number of print statements inside the update_users_investments function I can see that the function is being called and it is doing the right calculation. </p>
  
  <p>However, it is not saving to the database and there is no error. </p>
  
  <p>Can you see why it's not saving? And is there a better way to debug the save method? I have looked around and can't see anything, and not knowing <strong>why</strong> it isn't saving is very frustrating. </p>
  
  <p>Elsewhere in my code I use similar signals to save to other tables that appear to work fine. </p>
  
  <p>The signal</p>
  
  <pre><code>@receiver(post_save, sender=Investment)
  def update_users_investments(sender, instance, created, **kwargs):
      user = Profile.objects.get(user=instance.user.user)
      total_investments = user.total_invested
      investment = instance.transaction_type * instance.price * instance.number_shares
      user.total_invested = total_investments + investment
      user.save()
  </code></pre>
  
  <p>The model to be saving to:</p>
  
  <pre><code>class Profile(models.Model):
  
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      total_invested = models.DecimalField(max_digits=5, decimal_places=2)
      cash_avaliable = models.DecimalField(max_digits=5, decimal_places=2,
                                       null=True)
  </code></pre>
  
  <p>The investment model (which is where the signal is coming from):</p>
  
  <pre><code>class Investment(models.Model):
  
  """Model representing each investment made by users"""
  
      user = models.ForeignKey(Profile, on_delete=models.DO_NOTHING)
  
      team_code = models.ForeignKey(Team,
                             on_delete=models.DO_NOTHING)
  
      transaction_type = models.IntegerField(choices=((-1, "Sell"), (1, "Buy")),
                                         help_text="Show whether transaction\
                                         was a buy or sell",
                                         verbose_name="Transaction Type")
  
      number_shares = models.IntegerField(help_text="Number of shares bought or \
                                      sold in this transaction",
                                      verbose_name="Number of Shares")
  
      price = models.DecimalField(help_text = "Current Price of the team",
                                      verbose_name = "Current Price", decimal_places=2, max_digits=5)
  
      transaction_date = models.DateTimeField(auto_now=True, help_text="Date and \
                                          Time of transaction",
                                          verbose_name="Transaction Date")
  
      transaction_mode = models.IntegerField(choices=((-1, "User Generated"),
                                                  (1,
                                                   "Automatically Generated")))
  </code></pre>
  
  <h2>Edit</h2>
  
  <p>Have solved this - as pointed out the user = Profile.objects.get(user=instance.user.user) isn't required. </p>
  
  <pre><code>@receiver(post_save, sender=Investment)
  def update_users_investments(sender, instance, created, **kwargs):
      total_investments = instance.user.total_invested
      investment = instance.transaction_type * instance.price * instance.number_shares
      instance.user.total_invested = total_investments + investment
      instance.user.save()
  </code></pre>
  
  <p>Now appears to make it work :-)</p>