mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Don’t allow use of .get() on service model
Making people use a property is a sure way to make sure they’re spelling the name of the property correctly, and allows us to easily swap out properties that call through to the underlying JSON, and properties which are implemented as methods. The API should always return something in the JSON for a property, even if it’s just `None`.
This commit is contained in:
@@ -151,12 +151,12 @@ def get_apis():
|
||||
if current_service.service_callback_api:
|
||||
callback_api = service_api_client.get_service_callback_api(
|
||||
current_service.id,
|
||||
current_service.get('service_callback_api')[0]
|
||||
current_service.service_callback_api[0]
|
||||
)
|
||||
if current_service.inbound_api:
|
||||
inbound_api = service_api_client.get_service_inbound_api(
|
||||
current_service.id,
|
||||
current_service.get('inbound_api')[0]
|
||||
current_service.inbound_api[0]
|
||||
)
|
||||
|
||||
return (callback_api, inbound_api)
|
||||
@@ -251,7 +251,7 @@ def get_received_text_messages_callback():
|
||||
if current_service.inbound_api:
|
||||
return service_api_client.get_service_inbound_api(
|
||||
current_service.id,
|
||||
current_service.get('inbound_api')[0]
|
||||
current_service.inbound_api[0]
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user