Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
33afa3be
Commit
33afa3be
authored
May 03, 2022
by
Alexander Pace
Browse files
selectively hide reports link with env variable
parent
23d35284
Pipeline
#391021
passed with stages
in 30 minutes and 15 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/settings/base.py
View file @
33afa3be
...
...
@@ -29,8 +29,11 @@ MAINTENANCE_MODE_MESSAGE = None
INFO_BANNER_ENABLED
=
False
INFO_BANNER_MESSAGE
=
"TEST MESSAGE"
# Beta reports page:
BETA_REPORTS_LINK
=
False
# Version ---------------------------------------------------------------------
PROJECT_VERSION
=
'2.14.
1
'
PROJECT_VERSION
=
'2.14.
2
'
# Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is
...
...
config/settings/container/base.py
View file @
33afa3be
...
...
@@ -155,7 +155,7 @@ info_banner_enabled = get_from_env(
'DJANGO_INFO_BANNER_ENABLED'
,
default_value
=
False
,
fail_if_not_found
=
False
)
)
# fix for other booleans:
if
(
isinstance
(
info_banner_enabled
,
str
)
and
info_banner_enabled
.
lower
()
in
[
'true'
,
't'
,
'1'
]):
...
...
@@ -163,6 +163,17 @@ if (isinstance(info_banner_enabled, str) and
INFO_BANNER_MESSAGE
=
\
get_from_env
(
'DJANGO_INFO_BANNER_MESSAGE'
,
fail_if_not_found
=
False
)
# Get reports page boolean:
beta_reports_link
=
get_from_env
(
'DJANGO_BETA_REPORTS_LINK'
,
default_value
=
False
,
fail_if_not_found
=
False
)
# fix for other booleans:
if
(
isinstance
(
beta_reports_link
,
str
)
and
beta_reports_link
.
lower
()
in
[
'true'
,
't'
,
'1'
]):
BETA_REPORTS_LINK
=
True
# Get email settings from environment
EMAIL_BACKEND
=
'django_ses.SESBackend'
AWS_SES_ACCESS_KEY_ID
=
get_from_env
(
'AWS_SES_ACCESS_KEY_ID'
)
...
...
config/settings/vm/base.py
View file @
33afa3be
...
...
@@ -90,6 +90,8 @@ try:
except
:
DB_SLEEP_FACTOR
=
1.0
BETA_REPORTS_LINK
=
True
INSTANCE_STUB
=
"""
<li>Phone alerts (calls/SMS) are {0}</li>
<li>Email alerts are {1}</li>
...
...
gracedb/search/views.py
View file @
33afa3be
...
...
@@ -128,5 +128,8 @@ def latest(request):
# Update form to have query and errors (if they exist)
context
[
'form'
]
=
form
# put in conditional for reports page:
context
[
'beta_reports_link'
]
=
getattr
(
settings
,
'BETA_REPORTS_LINK'
,
False
)
return
render
(
request
,
'search/latest.html'
,
context
=
context
)
gracedb/templates/search/latest.html
View file @
33afa3be
...
...
@@ -21,7 +21,9 @@
<h3
style=
"font-weight:lighter; text-align:center;"
>
Latest as of {% now "j F Y H:i:s T" %}
</h3>
<hr
style=
"width:50%;text-align:center;margin:auto;"
>
{% if beta_reports_link %}
<p><h4
style=
"font-weight:lighter; text-align:center;"
><span
style=
"color:red;font-weight:bold;"
>
New:
</span>
view the beta reports page located
<a
href=
"{% url "
reports
"
%}"
>
here
</a></h4></p>
{% endif %}
<br>
<div
class=
"row justify-content-md-center"
>
<div
class=
"col-md-6 justify-content-center"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment