mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Fix empty table message
Bug was happening because: ```python bool(list()) >>> False ``` ```python bool((item for item in list())) >>> True ``` i.e. generator expressions cast to boolean are `True`, even if they’re empty – Python doesn’t evaluate them. This was causing the functional tests to fail because it was taking too long for any table rows to appear on the page.
This commit is contained in:
@@ -386,7 +386,7 @@ def get_job_partials(job):
|
||||
|
||||
|
||||
def add_preview_of_content_to_notifications(notifications):
|
||||
return (
|
||||
return [
|
||||
dict(
|
||||
preview_of_content=(
|
||||
str(Template(notification['template'], notification['personalisation']))
|
||||
@@ -396,4 +396,4 @@ def add_preview_of_content_to_notifications(notifications):
|
||||
**notification
|
||||
)
|
||||
for notification in notifications
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user