mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-26 18:32:15 -04:00
Don’t let people create a normal key in trial mode
You can’t properly use a normal key when your service is in trial mode. It’s theoretically useful to create a live key in preparation for going live. This utitily outweighs the confusion it causes for people creating their first keys in trial mode. We should just remove the confusing option.
This commit is contained in:
@@ -68,13 +68,12 @@ def create_api_key(service_id):
|
||||
key['name'] for key in api_key_api_client.get_api_keys(service_id=service_id)['apiKeys']
|
||||
]
|
||||
form = CreateKeyForm(key_names)
|
||||
form.key_type.choices = [
|
||||
(KEY_TYPE_NORMAL, 'Send messages to anyone{}'.format(
|
||||
', once this service is not in trial mode' if current_service['restricted'] else ''
|
||||
)),
|
||||
form.key_type.choices = filter(None, [
|
||||
(KEY_TYPE_NORMAL, 'Send messages to anyone{}')
|
||||
if not current_service['restricted'] else None,
|
||||
(KEY_TYPE_TEST, 'Simulate sending messages to anyone'),
|
||||
(KEY_TYPE_TEAM, 'Only send messages to your team or whitelist')
|
||||
]
|
||||
])
|
||||
if form.validate_on_submit():
|
||||
secret = api_key_api_client.create_api_key(
|
||||
service_id=service_id,
|
||||
|
||||
Reference in New Issue
Block a user