← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~thomir/launchpad/devel-change-gpgkey-vocabulary into lp:launchpad

 

Review: Needs Fixing code



Diff comments:

> === modified file 'lib/lp/registry/browser/person.py'
> --- lib/lp/registry/browser/person.py	2016-02-10 00:51:55 +0000
> +++ lib/lp/registry/browser/person.py	2016-02-29 19:13:28 +0000
> @@ -2641,18 +2641,16 @@
>          found = []
>          notfound = []
>          # Verify if we have multiple entries to activate.
> -        if not isinstance(key_ids, list):
> -            key_ids = [key_ids]
> +        if not isinstance(key_fingerprints, list):
> +            key_fingerprints = [key_fingerprints]
>  
>          gpghandler = getUtility(IGPGHandler)
> -        keyset = getUtility(IGPGKeySet)
>  
> -        for key_id in key_ids:
> -            gpgkey = keyset.get(key_id)

This removes the check that the key we're reactivating actually exists in the DB.

> +        for key_fingerprint in key_fingerprints:
>              try:
> -                key = gpghandler.retrieveKey(gpgkey.fingerprint)
> +                key = gpghandler.retrieveKey(key_fingerprint)
>              except GPGKeyNotFoundError:
> -                notfound.append(gpgkey.fingerprint)
> +                notfound.append(key_fingerprint)
>              else:
>                  found.append(key.displayname)
>                  self._validateGPG(key)


-- 
https://code.launchpad.net/~thomir/launchpad/devel-change-gpgkey-vocabulary/+merge/287515
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References