Compare commits

...

2 Commits

Author SHA1 Message Date
R. Miles McCain
2f778dc4b4 Bump version to v0.7.3 2021-01-11 12:12:15 -05:00
R. Miles McCain
e0c165313b Add fallback to percent_change_display (fixes #89) 2021-01-11 12:11:27 -05:00
2 changed files with 21 additions and 18 deletions

View File

@@ -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")

View File

@@ -18,7 +18,7 @@ import urllib.parse as urlparse
from django.contrib.messages import constants as messages from django.contrib.messages import constants as messages
# Increment on new releases # Increment on new releases
VERSION = "v0.7.2" VERSION = "v0.7.3"
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))