mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Sort API keys alphabetically
Currently the order of API keys seems to be non-deterministic:
d46caa184e/app/dao/api_key_dao.py (L32-L39)
Generally we sort things alphabetically, unless there’s a good reason to
do otherwise.
This commit sorts the API keys alphabetically.
This commit is contained in:
@@ -340,7 +340,10 @@ class Service():
|
||||
|
||||
@cached_property
|
||||
def api_keys(self):
|
||||
return api_key_api_client.get_api_keys(self.id)['apiKeys']
|
||||
return sorted(
|
||||
api_key_api_client.get_api_keys(self.id)['apiKeys'],
|
||||
key=lambda key: key['name'].lower(),
|
||||
)
|
||||
|
||||
@property
|
||||
def api_key_names(self):
|
||||
|
||||
Reference in New Issue
Block a user