added SHOW_SHYNET_VERSION env var to control display of version info

This commit is contained in:
Sudipto Ghosh
2020-08-31 18:08:00 +05:30
parent c524325f0a
commit 101d26d356
4 changed files with 22 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
from urllib.parse import urlparse
import os
import flag
import pycountry
from django import template
@@ -84,7 +85,8 @@ def percent_change_display(start, end):
@register.inclusion_tag("dashboard/includes/sidebar_footer.html")
def sidebar_footer():
return {"version": settings.VERSION}
return {"version": "" if settings.SHOW_SHYNET_VERSION
else settings.VERSION}
@register.inclusion_tag("dashboard/includes/stat_comparison.html")

View File

@@ -315,3 +315,6 @@ SCRIPT_HEARTBEAT_FREQUENCY = int(os.getenv("SCRIPT_HEARTBEAT_FREQUENCY", "5000")
# How much time can elapse between requests from the same user before a new
# session is created, in seconds?
SESSION_MEMORY_TIMEOUT = int(os.getenv("SESSION_MEMORY_TIMEOUT", "1800"))
# Should the Shynet version information be displayed?
SHOW_SHYNET_VERSION = os.getenv("SHOW_SHYNET_VERSION", "True") == "True"