From f51686f6b2c5bfd6c20e5716e5ae3fac81adaf9f Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Wed, 18 Oct 2023 16:44:38 +0100 Subject: [PATCH] Fix `get_users_with_repo_alert()` call Introduced in commit 1711e96dacf02724ae7d7f73d8cbc02201e88477 . --- lib/tool_shed/util/shed_util_common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tool_shed/util/shed_util_common.py b/lib/tool_shed/util/shed_util_common.py index 3f107c652ab3..016183204139 100644 --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -11,6 +11,7 @@ select, true, ) +from sqlalchemy.orm import scoped_session from galaxy import util from galaxy.tool_shed.util.shed_util_common import ( @@ -331,7 +332,7 @@ def handle_email_alerts(app, host, repository, content_alert_str="", new_repo_al subject = f"Galaxy tool shed alert for new repository named {str(repository.name)}" subject = subject[:80] email_alerts = [] - for user in get_users_with_repo_alert(sa_session.query, app.model.User): + for user in get_users_with_repo_alert(sa_session, app.model.User): if admin_only: if user.email in admin_users: email_alerts.append(user.email) @@ -463,6 +464,6 @@ def tool_shed_is_this_tool_shed(toolshed_base_url, trans=None): ) -def get_users_with_repo_alert(session, user_model): +def get_users_with_repo_alert(session: scoped_session, user_model): stmt = select(user_model).where(user_model.deleted == false()).where(user_model.new_repo_alert == true()) return session.scalars(stmt)