Skip to content

Commit

Permalink
Fix SA2.0 usage in tool_shed.webapp.util.shed_statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Oct 6, 2023
1 parent 9d17792 commit 8acdc89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tool_shed/webapp/util/shed_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
strftime,
)

from sqlalchemy import select

from tool_shed.webapp.model import Repository


class ShedCounter:
def __init__(self, model):
Expand Down Expand Up @@ -38,7 +42,7 @@ def generate_statistics(self):
self.unique_valid_tools = 0
self.workflows = 0
unique_user_ids = []
for repository in self.sa_session.query(self.model.Repository):
for repository in self.sa_session.scalars(select(Repository)):
self.repositories += 1
self.total_clones += repository.times_downloaded
is_deleted = repository.deleted
Expand Down

0 comments on commit 8acdc89

Please sign in to comment.