mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Move data transformation into the form
Follows what we’re doing with the folders stuff. Avoids having too many very straightforward methods on the model. Especially when the data they need is only used by the form. So it’s better to encapsulate the logic in the form.
This commit is contained in:
@@ -345,10 +345,6 @@ class Service():
|
||||
key=lambda key: key['name'].lower(),
|
||||
)
|
||||
|
||||
@property
|
||||
def api_key_names(self):
|
||||
return [key['name'] for key in self.api_keys]
|
||||
|
||||
def get_api_key(self, id):
|
||||
try:
|
||||
return next(key for key in self.api_keys if key['id'] == id)
|
||||
|
||||
Reference in New Issue
Block a user