From 5e0a5ddac3938d30272620bcae8ebf1956f38e64 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Thu, 15 Aug 2019 23:52:14 -0400 Subject: [PATCH] Fixing filter to map to allow signing --- packet/notifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packet/notifications.py b/packet/notifications.py index 51ae12a9..e427c5df 100644 --- a/packet/notifications.py +++ b/packet/notifications.py @@ -16,7 +16,7 @@ def packet_signed_notification(packet, signer): subscriptions = NotificationSubscription.query.filter_by(freshman_username=packet.freshman_username) if subscriptions: - tokens = list(filter(lambda subscription: subscription.token, subscriptions)) + tokens = list(map(lambda subscription: subscription.token, subscriptions)) notification = onesignal.Notification(post_body=post_body) notification.post_body["content"]["en"] = signer + ' signed your packet! Congrats or I\'m Sorry' @@ -32,7 +32,7 @@ def packet_signed_notification(packet, signer): def packet_100_percent_notification(packet): subscriptions = NotificationSubscription.query.all() if subscriptions: - tokens = list(filter(lambda subscription: subscription.token, subscriptions)) + tokens = list(map(lambda subscription: subscription.token, subscriptions)) notification = onesignal.Notification(post_body=post_body) notification.post_body["content"]["en"] = packet.freshman.name + ' got 💯 on packet!'