[PATCH v2 7/9] parser: avoid an unnecessary UPDATE of Person

Stephen Finucane stephen at that.guru
Sun Feb 25 23:26:42 AEDT 2018

On Sun, 2018-02-25 at 01:50 +1100, Daniel Axtens wrote:
> Analysis of SQL statements showed that when parsing an email, the row
> for the Person who sent the email was always getting updated. This is
> because the test for updating it only checks if the incoming mail has
> *a* name attached to the email address, and not if it has a new name.
> Django is not smart enough to figure that out, and so unconditionally
> UPDATEs the model when asked to save.
> Give it a hand - only update the model and save it if the new name is
> in fact different.

Reviewed-by: Stephen Finucane <stephen at that.guru>

More information about the Patchwork mailing list