From 51ecbdd124ab38b8de6b631e79daaac64366c9ed Mon Sep 17 00:00:00 2001 From: FSMPI Admin-Team <admin@fsmpi.rwth-aachen.de> Date: Tue, 7 Mar 2017 20:04:18 +0100 Subject: [PATCH] Correctly handle todo.is_done in sending todo mails --- tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index a214a47..95f3b22 100644 --- a/tasks.py +++ b/tasks.py @@ -478,7 +478,10 @@ def send_protocol_async(protocol_id, show_private): def send_todomails_async(protocol_id): with app.app_context(): protocol = Protocol.query.filter_by(id=protocol_id).first() - all_todos = Todo.query.filter(Todo.done == False).all() + all_todos = [ + todo for todo in Todo.query.filter.all() + if not todo.is_done() + ] users = {user for todo in all_todos for user in todo.get_users()} grouped_todos = { user: [todo for todo in all_todos if user in todo.get_users()] -- GitLab