mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Fix bug when editing letter contact block from letter template page
When viewing a letter template, there is a button to edit the letter contact block. This should take the user to the page to edit the letter contact block, but if a service has not set any letter contact blocks, the button was returning a 404 error. The code has now been changed so that if the service has no letter contact blocks the edit button will link to the page to add a letter contact block. Pivotal story: https://www.pivotaltracker.com/story/show/152881444
This commit is contained in:
@@ -58,7 +58,7 @@ def view_template(service_id, template_id):
|
||||
if template["template_type"] == "letter":
|
||||
letter_contact_details = service_api_client.get_letter_contacts(service_id)
|
||||
default_letter_contact_block_id = next(
|
||||
(x['id'] for x in letter_contact_details if x['is_default']), "None"
|
||||
(x['id'] for x in letter_contact_details if x['is_default']), None
|
||||
)
|
||||
else:
|
||||
default_letter_contact_block_id = None
|
||||
|
||||
Reference in New Issue
Block a user