From 10e3dcddcb23096596d66b65815d07d1e1af1f14 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:12:07 +0100 Subject: [PATCH 1/2] Remove web dependency from tools/errors.py --- lib/galaxy/tools/errors.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tools/errors.py b/lib/galaxy/tools/errors.py index 26aa0e017af9..da55ef82eaed 100644 --- a/lib/galaxy/tools/errors.py +++ b/lib/galaxy/tools/errors.py @@ -8,7 +8,6 @@ from galaxy import ( model, util, - web, ) from galaxy.security.validate_user_input import validate_email_str from galaxy.util import unicodify @@ -159,11 +158,11 @@ def _can_access_dataset(self, user): def create_report(self, user, email="", message="", redact_user_details_in_bugreport=False, **kwd): hda = self.hda job = self.job - host = web.url_for("/", qualified=True) + host = self.app.url_for("/", qualified=True) history_id_encoded = self.app.security.encode_id(hda.history_id) - history_view_link = web.url_for("/histories/view", id=history_id_encoded, qualified=True) + history_view_link = self.app.url_for("/histories/view", id=history_id_encoded, qualified=True) hda_id_encoded = self.app.security.encode_id(hda.id) - hda_show_params_link = web.url_for( + hda_show_params_link = self.app.url_for( controller="dataset", action="details", dataset_id=hda_id_encoded, qualified=True ) # Build the email message From af9ad6037d2a977e3eaf0bd9082e221ee82ecc70 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 21 Nov 2023 14:22:03 +0100 Subject: [PATCH 2/2] Remove web dependency from tools/error_reports --- lib/galaxy/tools/error_reports/plugins/slack.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/galaxy/tools/error_reports/plugins/slack.py b/lib/galaxy/tools/error_reports/plugins/slack.py index ee819b6f2669..10e3c69128b4 100644 --- a/lib/galaxy/tools/error_reports/plugins/slack.py +++ b/lib/galaxy/tools/error_reports/plugins/slack.py @@ -8,7 +8,6 @@ import requests -from galaxy import web from galaxy.util import string_as_bool from .base_git import BaseGitPlugin @@ -38,7 +37,7 @@ def _fill_issue_cache(self, *args, **kwargs): def submit_report(self, dataset, job, tool, **kwargs): history_id_encoded = self.app.security.encode_id(dataset.history_id) - history_view_link = web.url_for("/histories/view", id=history_id_encoded, qualified=True) + history_view_link = self.app.url_for("/histories/view", id=history_id_encoded, qualified=True) error_report_id = str(uuid.uuid4())[0:13] title = self._generate_error_title(job)