Skip to content

Commit

Permalink
remove link to webref from run page
Browse files Browse the repository at this point in the history
  • Loading branch information
backmari committed Nov 15, 2024
1 parent 6dae8e1 commit 2828cc2
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
8 changes: 0 additions & 8 deletions src/webmon_app/reporting/report/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import sys
import logging
import json
import string
import datetime
from django.http import HttpResponse, HttpResponseNotFound
from django.shortcuts import render, get_object_or_404
Expand Down Expand Up @@ -250,19 +249,12 @@ def detail(request, instrument, run_id):
except: # noqa: E722
prev_url = None

# Fitting URL
fitting_url = None
if hasattr(settings, "FITTING_URLS") and instrument.lower() in settings.FITTING_URLS:
url_template = string.Template(settings.FITTING_URLS[instrument.lower()])
fitting_url = url_template.substitute(run_number=run_id)

template_values = {
"instrument": instrument.upper(),
"run_object": run_object,
"status": status_objects,
"breadcrumbs": breadcrumbs,
"icat_info": icat_info,
"fitting_url": fitting_url,
"reduce_url": reduce_url,
"reduction_setup_url": reporting_view_util.reduction_setup_url(instrument),
"prev_url": prev_url,
Expand Down
5 changes: 1 addition & 4 deletions src/webmon_app/reporting/reporting_app/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def validate_ldap_settings(server_uri, user_dn_template):
CATALOG_URL = environ.get("CATALOG_URL")
CATALOG_ID = environ.get("CATALOG_ID")
CATALOG_SECRET = environ.get("CATALOG_SECRET")
CATALOG_API_TOKEN = environ.get("CATALOG_API_TOKEN")

# The DB settings are defined the same as in the workflow manager
DATABASES = {
Expand Down Expand Up @@ -365,10 +366,6 @@ def validate_ldap_settings(server_uri, user_dn_template):
for instr, facility in additions.items():
FACILITY_INFO[instr] = facility

# Link out to fitting application
FITTING_URLS = {}


# remote worker options
# setting these will force all execution to happen as a single user
TEST_REMOTE_USER = ""
Expand Down
2 changes: 0 additions & 2 deletions src/webmon_app/reporting/reporting_app/settings/envtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@
GENERAL_USER_USERNAME = environ.get("GENERAL_USER_USERNAME", "GeneralUser") # noqa: F405
GENERAL_USER_PASSWORD = environ.get("GENERAL_USER_PASSWORD", "GeneralUser") # noqa: F405

FITTING_URLS = {"ref_l": "https://reflectivity-test.ornl.gov/fit/ref_l/$run_number"}

validate_ldap_settings(server_uri=AUTH_LDAP_SERVER_URI, user_dn_template=AUTH_LDAP_USER_DN_TEMPLATE) # noqa: F405
2 changes: 0 additions & 2 deletions src/webmon_app/reporting/reporting_app/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = environ.get("DEBUG", False)

FITTING_URLS = {"ref_l": "https://reflectivity.sns.gov/fit/ref_l/$run_number"}

validate_ldap_settings(server_uri=AUTH_LDAP_SERVER_URI, user_dn_template=AUTH_LDAP_USER_DN_TEMPLATE) # noqa: F405
5 changes: 0 additions & 5 deletions src/webmon_app/reporting/templates/report/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@
<p>
{% endif %}

{% if fitting_url %}
<p>
<a href='{{ fitting_url }}' target="_blank">fit data</a> |
{% endif %}

{% if html_data %}
{% if data_url %}
Data access: <a href='{{ data_url }}'>download plot data points</a>
Expand Down
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions tests/data/REF_L/shared/autoreduce/reduce_REF_L.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
import os
import sys
import socket
from datetime import datetime
from postprocessing.publish_plot import publish_plot

if __name__ == "__main__":
time = datetime.isoformat(datetime.now())
filename = sys.argv[1]
print("Running reduction for " + filename + " at " + time)

publish_plot(
"REF_L",
os.path.basename(filename).split(".")[0].split("_")[-1],
files={
"file": f"<div><h>Example Plot Data</h><p>Filename: {filename}</p>"
f"<p>Time: {time}</p><p>Hostname: {socket.gethostname()}</p></div>"
},
)
Empty file.
Empty file.

0 comments on commit 2828cc2

Please sign in to comment.