Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Commit

Permalink
fix precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroroiz committed Apr 4, 2024
1 parent f6ddee1 commit e04726f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions confidant/routes/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,13 @@ def create_credential():
for key, value in credential_pairs.items():
value = escape(value)
credential_pairs[key] = value

# Verify this credential is not a duplicate of an existing credential
is_duplicate, duplicate_id = credentialmanager.is_key_value_pair_duplicate(
credential_pairs
)
if is_duplicate:
msg = '''Credential with the same key value pairs already exists.
msg = '''Credential with the same key value pairs already exists.
See id: {0}'''.format(duplicate_id)
return jsonify({'error': msg, 'reference': duplicate_id}), 409

Expand Down Expand Up @@ -881,9 +881,10 @@ def update_credential(id):
update['last_rotation_date'] = misc.utcnow()

# Verify if after update the credential will not be a duplicate
is_duplicate, duplicate_id = credentialmanager.is_key_value_pair_duplicate(
credential_pairs
)
is_duplicate, duplicate_id = \
credentialmanager.is_key_value_pair_duplicate(
credential_pairs
)
if is_duplicate:
msg = '''Credential with the same key value pairs already exists.
See id: {0}'''.format(duplicate_id)
Expand Down

0 comments on commit e04726f

Please sign in to comment.