Move unknown organisation logic into Jinja

Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
This commit is contained in:
Chris Hill-Scott
2021-10-11 15:24:55 +01:00
parent eefc903b25
commit 72742cf477
3 changed files with 5 additions and 18 deletions

View File

@@ -520,5 +520,7 @@ def format_billions(count):
return humanize.intword(count)
def format_yes_no(value):
return 'Yes' if value else 'No'
def format_yes_no(value, yes='Yes', no='No', none='No'):
if value is None:
return none
return yes if value else no