mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Don’t do multiple get API calls when revoking
It’s redundant to make two API calls here, one to get all keys and one to get a single key. Since the API calls are sequential we can speed things up by getting the one key from the list of all keys.
This commit is contained in:
@@ -128,7 +128,7 @@ def create_api_key(service_id):
|
||||
@login_required
|
||||
@user_has_permissions('manage_api_keys')
|
||||
def revoke_api_key(service_id, key_id):
|
||||
key_name = api_key_api_client.get_api_keys(service_id=service_id, key_id=key_id)['apiKeys'][0]['name']
|
||||
key_name = current_service.get_api_key(key_id)['name']
|
||||
if request.method == 'GET':
|
||||
return render_template(
|
||||
'views/api/keys.html',
|
||||
|
||||
Reference in New Issue
Block a user