Commit 9d333224 authored by Administrator's avatar Administrator
Browse files

Do not implicitely assume todos have a protocol

parent 8d5fc85f
......@@ -174,7 +174,7 @@ def index():
def _todo_sort_key(todo):
protocol = todo.get_first_protocol()
return if is not None else
return if protocol is not None and is not None else
todos = sorted(todos, key=_todo_sort_key, reverse=True)
todos_table = TodosTable(todos) if todos is not None else None
return render_template("index.html", open_protocols=open_protocols, protocol=protocol, todos=todos)
......@@ -319,12 +319,12 @@ class TodosTable(Table):
def row(self, todo):
user = current_user()
protocol = todo.get_first_protocol()
mobile_parts = ["show_todo",, todo.get_state())]
if protocol is not None:
mobile_parts.append("show_protocol",, todo.protocoltype.short_name))
row = [
Markup("<br>").join(["show_todo",, todo.get_state()),"show_protocol",, todo.protocoltype.short_name),
Markup("<br>").join(mobile_parts),"show_todo",, todo.get_id()),
todo.get_state(),"show_protocol",, protocol.get_identifier())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment