diff --git a/GeoHealthCheck/app.py b/GeoHealthCheck/app.py index ff317bca..504e5f13 100644 --- a/GeoHealthCheck/app.py +++ b/GeoHealthCheck/app.py @@ -767,7 +767,10 @@ def edit_resource(resource_identifier): flash(gettext('Resource not found'), 'danger') return redirect(request.referrer) - probes_avail = views.get_probes_avail(resource.resource_type, resource) + # Editing must remain possible when the monitored service is unavailable. + # Probe expansion can make live GetCapabilities requests. + probes_avail = views.get_probes_avail(resource.resource_type, resource, + expand_params=False) suggestions = json.dumps(Recipient.get_suggestions('email', g.user.username)) diff --git a/GeoHealthCheck/probe.py b/GeoHealthCheck/probe.py index 937e0866..5ec03d23 100644 --- a/GeoHealthCheck/probe.py +++ b/GeoHealthCheck/probe.py @@ -90,6 +90,9 @@ class Probe(Plugin): def __init__(self): Plugin.__init__(self) + # expand_params() modifies these definitions for a Resource. Keep + # choices from one Resource out of other requests and edit forms. + self.PARAM_DEFS = Plugin.copy(self.PARAM_DEFS) self._resource = None self._session = create_requests_retry_session() diff --git a/GeoHealthCheck/templates/includes/probe_edit_form.html b/GeoHealthCheck/templates/includes/probe_edit_form.html index 00198f94..53e88df9 100644 --- a/GeoHealthCheck/templates/includes/probe_edit_form.html +++ b/GeoHealthCheck/templates/includes/probe_edit_form.html @@ -28,8 +28,8 @@ {% set probe_param_type = 'list' %} {% set probe_param_val = probe_param_val|join(',') %} {% endif %} - - {% if probe_param_range %} + + {% if probe_param_range and (not probe_param_val or probe_param_val in probe_param_range) %}