← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~wgrant/launchpad/bugzilla-alias-list into lp:launchpad

 

Review: Approve



Diff comments:

> 
> === modified file 'lib/lp/bugs/externalbugtracker/bugzilla.py'
> --- lib/lp/bugs/externalbugtracker/bugzilla.py	2015-07-08 16:05:11 +0000
> +++ lib/lp/bugs/externalbugtracker/bugzilla.py	2017-01-06 23:45:51 +0000
> @@ -620,8 +620,13 @@
>              # IDs. We use the aliases dict to look up the correct ID for
>              # a bug. This allows us to reference a bug by either ID or
>              # alias.
> -            if remote_bug.get('alias', '') != '':
> -                self._bug_aliases[remote_bug['alias']] = remote_bug['id']
> +            # Some versions of Bugzilla return a single alias string,
> +            # others return a (possibly empty) list.
> +            aliases = remote_bug.get('alias', '')
> +            if isinstance(aliases, basestring):

Maybe s/basestring/six.string_types/ by way of forward planning.

> +                aliases = [] if not aliases else [aliases]
> +            for alias in aliases:
> +                self._bug_aliases[alias] = remote_bug['id']
>  
>      @ensure_no_transaction
>      def getCurrentDBTime(self):


-- 
https://code.launchpad.net/~wgrant/launchpad/bugzilla-alias-list/+merge/314265
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References