Diff comments:

> 
> === modified file 'lib/lp/bugs/externalbugtracker/bugzilla.py'
> --- lib/lp/bugs/externalbugtracker/bugzilla.py        2017-01-14 07:41:41 
> +0000
> +++ lib/lp/bugs/externalbugtracker/bugzilla.py        2017-10-20 11:30:23 
> +0000
> @@ -839,12 +844,18 @@
>          comment = self._bugs[actual_bug_id]['comments'][comment_id]
>          display_name, email = parseaddr(comment['author'])
>  
> -        # If the name is empty then we return None so that
> -        # IPersonSet.ensurePerson() can actually do something with it.
> -        if not display_name:
> -            display_name = None
> -
> -        return (display_name, email)
> +        # If the email isn't valid, return the email address as the
> +        # display name (a Launchpad Person will be created with this
> +        # name).
> +        if not valid_email(email):
> +            return email, None

I'd marginally prefer the "if '@' not in email:" approach, but up to you.

> +        # If the display name is empty, set it to None so that it's
> +        # useable by IPersonSet.ensurePerson().
> +        elif display_name == '':
> +            return None, email
> +        # Both displayname and email are valid, return both.
> +        else:
> +            return display_name, email
>  
>      def getMessageForComment(self, remote_bug_id, comment_id, poster):
>          """See `ISupportsCommentImport`."""


-- 
https://code.launchpad.net/~cjwatson/launchpad/bugtracker-redhat-fixes/+merge/332559
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to