Commit 2176fdbe authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Add server code version to home page and API

parent 368ee8f2
Pipeline #58642 passed with stages
in 11 minutes and 43 seconds
...@@ -21,6 +21,9 @@ def get_from_env(envvar, default_value=None, fail_if_not_found=True): ...@@ -21,6 +21,9 @@ def get_from_env(envvar, default_value=None, fail_if_not_found=True):
'Could not get environment variable {0}'.format(envvar)) 'Could not get environment variable {0}'.format(envvar))
return value return value
# Version ---------------------------------------------------------------------
PROJECT_VERSION = '2.4.3'
# Unauthenticated access ------------------------------------------------------ # Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is # This variable should eventually control whether unauthenticated access is
# allowed *ANYWHERE* on this service, except the home page, which is always # allowed *ANYWHERE* on this service, except the home page, which is always
......
...@@ -150,6 +150,9 @@ class GracedbRoot(APIView): ...@@ -150,6 +150,9 @@ class GracedbRoot(APIView):
"signoff-statuses": dict(SignoffBase.OPERATOR_STATUS_CHOICES), "signoff-statuses": dict(SignoffBase.OPERATOR_STATUS_CHOICES),
"instruments": dict(SignoffBase.INSTRUMENT_CHOICES), "instruments": dict(SignoffBase.INSTRUMENT_CHOICES),
"voevent-types" : dict(VOEvent.VOEVENT_TYPE_CHOICES), "voevent-types" : dict(VOEvent.VOEVENT_TYPE_CHOICES),
"api-versions": api_settings.ALLOWED_VERSIONS,
"server-version": settings.PROJECT_VERSION,
# Maintained for backwards compatibility with client
"API_VERSIONS": api_settings.ALLOWED_VERSIONS, "API_VERSIONS": api_settings.ALLOWED_VERSIONS,
}) })
......
...@@ -99,6 +99,9 @@ def index(request): ...@@ -99,6 +99,9 @@ def index(request):
signoff_instrument = group.name[:2].upper() signoff_instrument = group.name[:2].upper()
break break
# Server code version
context['server_version'] = settings.PROJECT_VERSION
context['signoff_authorized'] = signoff_authorized context['signoff_authorized'] = signoff_authorized
context['signoff_instrument'] = signoff_instrument context['signoff_instrument'] = signoff_instrument
......
...@@ -88,6 +88,7 @@ body { ...@@ -88,6 +88,7 @@ body {
<li><a href="https://gw-astronomy.org/wiki/LV_EM/TechInfo">LV-EM Technical Info</a></li> <li><a href="https://gw-astronomy.org/wiki/LV_EM/TechInfo">LV-EM Technical Info</a></li>
<li><a href="https://dcc.ligo.org/G1501296">Tutorial for operators and detector engineers</a></li> <li><a href="https://dcc.ligo.org/G1501296">Tutorial for operators and detector engineers</a></li>
</ul> </ul>
<p>Server code version: <b>{{server_version}}</b></p>
{% endif %} {% endif %}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment