Add fallback to percent_change_display (fixes #89)
This commit is contained in:
parent
c86192d301
commit
e0c165313b
@ -61,6 +61,7 @@ def relative_stat_tone(
|
|||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def percent_change_display(start, end):
|
def percent_change_display(start, end):
|
||||||
|
try:
|
||||||
if start == None or end == None:
|
if start == None or end == None:
|
||||||
return SafeString("Δ n/a")
|
return SafeString("Δ n/a")
|
||||||
if start == end:
|
if start == end:
|
||||||
@ -80,6 +81,8 @@ def percent_change_display(start, end):
|
|||||||
pct_change = str(change) + "%"
|
pct_change = str(change) + "%"
|
||||||
|
|
||||||
return SafeString(direction + pct_change)
|
return SafeString(direction + pct_change)
|
||||||
|
except: # TODO: filter for specific issues
|
||||||
|
return SafeString("Δ ?")
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag("dashboard/includes/sidebar_footer.html")
|
@register.inclusion_tag("dashboard/includes/sidebar_footer.html")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user