← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/destroy-ascii-smash into lp:launchpad

 


Diff comments:

> === modified file 'lib/lp/soyuz/adapters/notification.py'
> --- lib/lp/soyuz/adapters/notification.py	2015-03-13 19:05:50 +0000
> +++ lib/lp/soyuz/adapters/notification.py	2015-07-07 13:35:34 +0000
> @@ -591,6 +574,25 @@
>          return format_address_for_person(person)
>  
>  

11:41 <cjwatson> wgrant: Shall I take it from your review that you would like me to fix IPersonSet.getByEmail(None) to return None?
11:41 <cjwatson> AttributeError: 'NoneType' object has no attribute 'lower'
11:57 <wgrant> cjwatson: Oh, hm, nevermind then.

> +def fix_email(fullemail, field_name):
> +    """Turn an email address from .changes into various useful forms.
> +
> +    The input address may be None, or anything that `fix_maintainer`
> +    understands.
> +
> +    :return: A tuple of (RFC2047-compatible address, Unicode
> +        RFC822-compatible address, email).
> +    """
> +    if not fullemail:
> +        return None, None, None
> +
> +    try:
> +        rfc822, rfc2047, _, email = safe_fix_maintainer(fullemail, field_name)
> +        return rfc2047, rfc822.decode('utf-8'), email
> +    except ParseMaintError:
> +        return None, None, None
> +
> +
>  def is_auto_sync_upload(spr, bprs, pocket, changed_by_email):
>      """Return True if this is a (Debian) auto sync upload.
>  


-- 
https://code.launchpad.net/~cjwatson/launchpad/destroy-ascii-smash/+merge/264039
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References