diff options
author | Philipp Hörist <philipp@hoerist.com> | 2019-04-17 00:27:05 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2019-04-17 00:27:05 +0300 |
commit | 4cad7462b1e3d59730257482c1a9f83e9578de7e (patch) | |
tree | 083add5bb8cf3e5b25447f4f99259086cb5ab870 /pgp | |
parent | 0d99f3a2d5ee9f171a96a841e129751fe10d3868 (diff) |
[pgp] Fix key migration
Diffstat (limited to 'pgp')
-rw-r--r-- | pgp/backend/store.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pgp/backend/store.py b/pgp/backend/store.py index bb094c0..dea8568 100644 --- a/pgp/backend/store.py +++ b/pgp/backend/store.py @@ -50,9 +50,10 @@ class KeyStore: def _migrate(self): keys = {} attached_keys = app.config.get_per( - 'accounts', self._account, 'attached_gpg_keys').split() - if attached_keys is None: + 'accounts', self._account, 'attached_gpg_keys') + if not attached_keys: return + attached_keys = attached_keys.split() for i in range(len(attached_keys) // 2): keys[attached_keys[2 * i]] = attached_keys[2 * i + 1] @@ -64,6 +65,9 @@ class KeyStore: own_key_user = app.config.get_per('accounts', self._account, 'keyname') if own_key_id: self.set_own_key_data((own_key_id, own_key_user)) + + attached_keys = app.config.set_per( + 'accounts', self._account, 'attached_gpg_keys', '') self._log.info('Migration successful') @delay_execution(500) |