Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
9d333224
Commit
9d333224
authored
Mar 20, 2017
by
Administrator
Browse files
Do not implicitely assume todos have a protocol
parent
8d5fc85f
Changes
2
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
9d333224
...
...
@@ -174,7 +174,7 @@ def index():
]
def
_todo_sort_key
(
todo
):
protocol
=
todo
.
get_first_protocol
()
return
protocol
.
date
if
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
()
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
)
...
...
views/tables.py
View file @
9d333224
...
...
@@ -319,12 +319,12 @@ class TodosTable(Table):
def
row
(
self
,
todo
):
user
=
current_user
()
protocol
=
todo
.
get_first_protocol
()
mobile_parts
=
[
Table
.
link
(
url_for
(
"show_todo"
,
todo_id
=
todo
.
id
),
todo
.
get_state
())]
if
protocol
is
not
None
:
mobile_parts
.
append
(
Table
.
link
(
url_for
(
"show_protocol"
,
protocol_id
=
protocol
.
id
),
todo
.
protocoltype
.
short_name
))
mobile_parts
.
append
(
todo
.
who
)
row
=
[
Markup
(
"<br>"
).
join
([
Table
.
link
(
url_for
(
"show_todo"
,
todo_id
=
todo
.
id
),
todo
.
get_state
()),
Table
.
link
(
url_for
(
"show_protocol"
,
protocol_id
=
protocol
.
id
),
todo
.
protocoltype
.
short_name
),
todo
.
who
]),
Markup
(
"<br>"
).
join
(
mobile_parts
),
Table
.
link
(
url_for
(
"show_todo"
,
todo_id
=
todo
.
id
),
todo
.
get_id
()),
todo
.
get_state
(),
Table
.
link
(
url_for
(
"show_protocol"
,
protocol_id
=
protocol
.
id
),
protocol
.
get_identifier
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment