diff --git a/nc_password_client/nc_password_client.py b/nc_password_client/nc_password_client.py index e3635be..aededb1 100755 --- a/nc_password_client/nc_password_client.py +++ b/nc_password_client/nc_password_client.py @@ -930,9 +930,17 @@ class NextcloudHandler: } ) else: - if update: + if update and 'id' in exists_password: new_obj['id'] = exists_password['id'] return self.update_password(new_obj) + if 'id' not in exists_password: + self.debug( + { + "action": "create_password", + "message": "Found an existing password without an 'id'", + "existing_password": exists_password + } + ) self.warning( { "action": "create_password", diff --git a/requirements.txt b/requirements.txt index 7f8998e..2288427 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ pysodium passpy secretstorage pyyaml +libsodium