[PATCH v2 11/11] parsemail: Always update Person.email
Andy Doan
andy.doan at linaro.org
Sat Apr 9 04:07:09 AEST 2016
On 04/01/2016 09:57 AM, Stephen Finucane wrote:
> Patches applied using pwclient will always use the first name that has
> been seen for a particular email address. While this is usually fine,
> ot actually causes issues for people changing name without changing
> email addresses or people changing the capitalization of their name.
> Resolve this by always updating the Person object when we receive a
> new submission or comment.
>
> Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
> Closes: #24
Reviewed-by: Andy Doan <andy.doan at linaro.org>
> refs = find_references(mail)
> @@ -489,8 +489,7 @@ def parse_mail(mail, list_id=None):
>
> if diff or pull_url: # patches or pull requests
> # we delay the saving until we know we have a patch.
> - if save_required:
> - author.save()
> + author.save()
>
> delegate = find_delegate(mail)
> if not delegate and diff:
> @@ -527,8 +526,7 @@ def parse_mail(mail, list_id=None):
> is_cover_letter = True
>
> if is_cover_letter:
> - if save_required:
> - author.save()
> + author.save()
>
> cover_letter = CoverLetter(
> msgid=msgid,
> @@ -550,9 +548,7 @@ def parse_mail(mail, list_id=None):
> if not submission:
> return
>
> - # ...and we only save the author if we're saving the comment
> - if save_required:
> - author.save()
> + author.save()
>
> comment = Comment(
> submission=submission,
>
Having to repeat author.save() multiple place is brittle. However, I'm
guessing this can probably addressed separately by cleaning up this
function a tad.
More information about the Patchwork
mailing list