diff --git a/src/lkadmin/archive.py b/src/lkadmin/archive.py index 072b42fd..6494cb34 100644 --- a/src/lkadmin/archive.py +++ b/src/lkadmin/archive.py @@ -623,7 +623,7 @@ def update_uploaders(dir_path, auto=False, no_confirm=False): if not no_confirm: data_src = git_url if git_url else dir_path proceed_answer = Confirm.ask( - 'Update users with data from {}? This will DELETE and users not present in this directory!'.format(data_src) + 'Update users with data from {}? This will DELETE all users not present in this directory!'.format(data_src) ) if not proceed_answer: return @@ -671,7 +671,6 @@ def update_uploaders(dir_path, auto=False, no_confirm=False): session.add(user) user.name = uconf.get('name', '') user.alias = uconf.get('alias', None) - user.pgp_fingerprints = fingerprints user.is_human = uconf.get('is_human', True) user.allow_source_uploads = uconf.get('allow_source_uploads', True) user.allow_binary_uploads = uconf.get('allow_binary_uploads', False) @@ -696,11 +695,9 @@ def update_uploaders(dir_path, auto=False, no_confirm=False): # update GPG keys for fpr in fingerprints: used_fprs.add(fpr) - # check if we already have the key for existing users - if fpr in uploader_fprs: - continue - # check if the key was already added to the current user in the current import cycle - if fpr in user.pgp_fingerprints: + # Check if the key was already added to the current user in the current import cycle + # and if we have it in the global GPG keyring (and skip adding it again in that case) + if fpr in user.pgp_fingerprints and fpr in uploader_fprs: continue log.info('Importing key %s for %s', fpr, email) import_key_file_for_uploader(user, os.path.join(uconf_root, fpr + '.asc'))