[email] Fix database call

This commit is contained in:
maike 2020-07-12 16:46:37 +02:00 committed by dl6tom
parent 3bc43a51e9
commit 8211a29ebd

View file

@ -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']