Skip to content
Snippets Groups Projects
Commit f2077810 authored by Julian's avatar Julian
Browse files

Simplify if-condition in tables.py

parent 02064911
No related branches found
No related tags found
1 merge request!111Resolve "[Person overview] Implement multiple selection for marking absences as excused or for deleting"
......@@ -133,14 +133,13 @@ class PersonalNoteTable(tables.Table):
)
def render_excused(self, value, record):
if record.absent:
if value:
context = dict(content=_("Excused"), classes="green white-text")
if record.absent and value:
context = dict(content=_("Excused"), classes="green white-text")
badge = render_to_string("components/materialize-chips.html", context)
if record.excuse_type:
context = dict(content=record.excuse_type.name, classes="green white-text")
badge = render_to_string("components/materialize-chips.html", context)
if record.excuse_type:
context = dict(content=record.excuse_type.name, classes="green white-text")
badge = render_to_string("components/materialize-chips.html", context)
return badge
return badge
return ""
def render_late(self, value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment