mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 02:23:32 -04:00
Add method to count of live services and orgs
So that we don’t have to update the home page manually any more.
This commit is contained in:
@@ -61,6 +61,14 @@ def dao_fetch_all_services(only_active=False):
|
||||
return query.all()
|
||||
|
||||
|
||||
def dao_count_live_services():
|
||||
return Service.query.filter_by(
|
||||
active=True,
|
||||
restricted=False,
|
||||
count_as_live=True,
|
||||
).count()
|
||||
|
||||
|
||||
def dao_fetch_service_by_id(service_id, only_active=False):
|
||||
query = Service.query.filter_by(
|
||||
id=service_id
|
||||
|
||||
Reference in New Issue
Block a user