mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -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:
@@ -87,7 +87,7 @@ def api_keys(service_id):
|
||||
@login_required
|
||||
@user_has_permissions('manage_api_keys', restrict_admin_usage=True)
|
||||
def create_api_key(service_id):
|
||||
form = CreateKeyForm(current_service.api_key_names)
|
||||
form = CreateKeyForm(current_service.api_keys)
|
||||
form.key_type.choices = [
|
||||
(KEY_TYPE_NORMAL, 'Live – sends to anyone'),
|
||||
(KEY_TYPE_TEAM, 'Team and whitelist – limits who you can send to'),
|
||||
|
||||
Reference in New Issue
Block a user