Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor Controller.get_source_count() into securedrop_client.storage #2303

Open
cfm opened this issue Nov 15, 2024 · 0 comments
Open

refactor Controller.get_source_count() into securedrop_client.storage #2303

cfm opened this issue Nov 15, 2024 · 0 comments
Assignees
Labels
♻️ Refactoring This PR is a strict refactoring.
Milestone

Comments

@cfm
Copy link
Member

cfm commented Nov 15, 2024

def get_source_count(self) -> int:
"""
Return total sources in local storage.
"""
return self.session.query(db.Source).count()

On second review I realize I was thinking of this in the wrong context: I thought this method was a function in securedrop_client.storage. Strictly speaking, the Controller shouldn't make a session.query() directly. But this is just a matter of organization, not threading, so let's leave it for now.

Originally posted by @cfm in #2300 (comment)

@cfm cfm self-assigned this Nov 15, 2024
@cfm cfm added the ♻️ Refactoring This PR is a strict refactoring. label Nov 15, 2024
@cfm cfm moved this to Ready to go in SecureDrop dev cycle Nov 15, 2024
@cfm cfm added this to the 0.15.0 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ Refactoring This PR is a strict refactoring.
Projects
Status: Ready to go
Development

No branches or pull requests

1 participant