Skip to content
Snippets Groups Projects
Commit 6b71e095 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Show just the todos belonging to the current user

If there are todos which have todo.who == current_user.username, show
only them, as there may be quite a lot of open todos in total.

/close #90
parent e5408a22
No related branches found
No related tags found
No related merge requests found
...@@ -175,6 +175,12 @@ def index(): ...@@ -175,6 +175,12 @@ def index():
if todo.protocoltype.has_private_view_right(user) if todo.protocoltype.has_private_view_right(user)
and not todo.is_done() and not todo.is_done()
] ]
user_todos = [
todo for todo in todos
if user.username.lower() in list(map(str.strip, todo.who.lower().split(",")))
]
if len(user_todos) > 0:
todos = user_todos
def _todo_sort_key(todo): def _todo_sort_key(todo):
protocol = todo.get_first_protocol() protocol = todo.get_first_protocol()
return protocol.date if protocol is not None and protocol.date is not None else datetime.now().date() return protocol.date if protocol is not None and protocol.date is not None else datetime.now().date()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment