mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Use new API endpoint to get single contact list
When we first built the contact list feature this endpoint didn’t exist. Now it does we can remove the slightly cludgy looping-through-all-the-lists code.
This commit is contained in:
@@ -32,11 +32,10 @@ class ContactList(JSONModel):
|
||||
|
||||
@classmethod
|
||||
def from_id(cls, contact_list_id, *, service_id):
|
||||
# This is temporary until we have a get single list endpoint
|
||||
for contact_list in ContactLists(service_id):
|
||||
if contact_list.id == contact_list_id:
|
||||
return contact_list
|
||||
abort(404)
|
||||
return cls(contact_list_api_client.get_contact_list(
|
||||
service_id=service_id,
|
||||
contact_list_id=contact_list_id,
|
||||
))
|
||||
|
||||
@staticmethod
|
||||
def get_bucket_name():
|
||||
|
||||
Reference in New Issue
Block a user