Commit 82c9fd8f authored by Jose Semedo's avatar Jose Semedo
Browse files

Changing slice on processor and removing slice on template.

parent 4a42e293
......@@ -56,20 +56,23 @@ class EmailFeedProcessor(Processor):
notification_ids = kwargs["notifications"]
notifications = self.data_source.get_channel_notifications(notification_ids)
for notification in notifications[0:3]:
{('body', BeautifulSoup(notification['body'], "lxml").get_text(" "))}
grouped_notifications = itertools.groupby(
lambda n: (n['targetId'], n['channel']['name'], n['channel']['slug'])
def prepare_notifications(notifications):
for notification in notifications:
{('body', BeautifulSoup(notification['body'], "lxml").get_text(" "))}
return notifications
context = {
"title": title,
"notification_priority": NotificationPriority,
# Jinja2 Renderer Fix
"channel_notifications": [(k, list(g)) for k, g in grouped_notifications],
"channel_notifications": [(k, prepare_notifications(list(g)[0:3])) for k, g in grouped_notifications],
"sender": Config.SERVICE_NAME,
......@@ -21,7 +21,7 @@
{% for notification in notifications[:3] %}
{% for notification in notifications %}
<td style="padding:10px">
<p><b>{% if notification.priority and notification.priority.upper() ==
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment