From 8211a29ebd2a10d69a38f32f7230874ecf6f5e54 Mon Sep 17 00:00:00 2001 From: maike Date: Sun, 12 Jul 2020 16:46:37 +0200 Subject: [PATCH] [email] Fix database call --- kibicara/platforms/email/bot.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kibicara/platforms/email/bot.py b/kibicara/platforms/email/bot.py index 43c3e12..e5f5f6b 100644 --- a/kibicara/platforms/email/bot.py +++ b/kibicara/platforms/email/bot.py @@ -24,11 +24,7 @@ class EmailBot(Censor): """ Loop which waits for new messages and sends emails to all subscribers. """ while True: message = await self.receive() - for subscriber in EmailSubscribers(hood=self.hood.id): - payload = { - 'email': subscriber.email, - 'hood': self.hood.id, - } + for subscriber in EmailSubscribers.objects.filter(hood=self.hood.id): token = to_token(email=subscriber.email, hood=self.hood.id) unsubscribe_link = ( config['root_url']