Remove provider_statistics_dao.get_provider_statistics

The provider_statistics table is no longer being populated, get rid of any reads from this table.
This commit is contained in:
Rebecca Law
2016-09-19 17:24:26 +01:00
parent aeba205b31
commit 51b3119a21
4 changed files with 25 additions and 65 deletions

View File

@@ -1,9 +1,7 @@
from sqlalchemy import func, cast, Float, case
from sqlalchemy import func
from app import db
from app.models import (
ProviderStatistics,
ProviderDetails,
NotificationHistory,
SMS_TYPE,
EMAIL_TYPE,
@@ -12,15 +10,6 @@ from app.models import (
)
def get_provider_statistics(service, **kwargs):
query = ProviderStatistics.query.filter_by(service=service)
if 'providers' in kwargs:
providers = ProviderDetails.query.filter(ProviderDetails.identifier.in_(kwargs['providers'])).all()
provider_ids = [provider.id for provider in providers]
query = query.filter(ProviderStatistics.provider_id.in_(provider_ids))
return query
def get_fragment_count(service_id):
shared_filters = [
NotificationHistory.service_id == service_id,