Skip to content
Snippets Groups Projects
Commit 2176fdbe authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Add server code version to home page and API

parent 368ee8f2
No related branches found
No related tags found
No related merge requests found
......@@ -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))
return value
# Version ---------------------------------------------------------------------
PROJECT_VERSION = '2.4.3'
# Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is
# allowed *ANYWHERE* on this service, except the home page, which is always
......
......@@ -150,6 +150,9 @@ class GracedbRoot(APIView):
"signoff-statuses": dict(SignoffBase.OPERATOR_STATUS_CHOICES),
"instruments": dict(SignoffBase.INSTRUMENT_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,
})
......
......@@ -99,6 +99,9 @@ def index(request):
signoff_instrument = group.name[:2].upper()
break
# Server code version
context['server_version'] = settings.PROJECT_VERSION
context['signoff_authorized'] = signoff_authorized
context['signoff_instrument'] = signoff_instrument
......
......@@ -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://dcc.ligo.org/G1501296">Tutorial for operators and detector engineers</a></li>
</ul>
<p>Server code version: <b>{{server_version}}</b></p>
{% endif %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment