Skip to content

Commit

Permalink
Fix get_users_with_repo_alert() call
Browse files Browse the repository at this point in the history
Introduced in commit 1711e96 .
  • Loading branch information
nsoranzo committed Oct 18, 2023
1 parent c3aa0cd commit 85587c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tool_shed/util/shed_util_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 85587c0

Please sign in to comment.