Skip to content

Commit

Permalink
fix: Add support for target_warning_message context variable (#634)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Christie <alan.christie@matildapeak.com>
  • Loading branch information
alanbchristie and Alan Christie authored Aug 27, 2024
1 parent 6fad98c commit 97a56a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fragalysis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@

TARGET_LOADER_MEDIA_DIRECTORY: str = "target_loader_data"

# A warning messages issued by the f/e.
# Used, if set, to populate the 'target_warning_message' context variable
TARGET_WARNING_MESSAGE: str = os.environ.get("TARGET_WARNING_MESSAGE", "")

# The Target Access String (TAS) Python regular expression.
# The Project title (the TAS) must match this expression to be valid.
# See api/utils.py validate_tas() for the current implementation.
Expand Down
3 changes: 3 additions & 0 deletions viewer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def react(request):
if sq2_rv.success and check_squonk_active(request):
context['squonk_ui_url'] = _SQ2A.get_ui_url()

if settings.TARGET_WARNING_MESSAGE:
context['target_warning_message'] = settings.TARGET_WARNING_MESSAGE

return render(request, "viewer/react_temp.html", context)


Expand Down

0 comments on commit 97a56a5

Please sign in to comment.