Delete old platform-stats route

We no longer need the `/platform-stats` route in the service blueprint,
because admin is using the new `/platform-stats` route in the platform stats
blueprint instead.
This commit is contained in:
Katie Smith
2018-07-10 14:59:24 +01:00
parent 07d274c2e6
commit 0cb9e335b9
3 changed files with 0 additions and 96 deletions

View File

@@ -47,7 +47,6 @@ from app.dao.services_dao import (
dao_remove_user_from_service,
dao_suspend_service,
dao_update_service,
fetch_aggregate_stats_by_date_range_for_all_services,
fetch_stats_by_date_range_for_all_services
)
from app.dao.service_whitelist_dao import (
@@ -116,25 +115,6 @@ def handle_integrity_error(exc):
return jsonify(result='error', message="Internal server error"), 500
@service_blueprint.route('/platform-stats', methods=['GET'])
def get_platform_stats():
include_from_test_key = request.args.get('include_from_test_key', 'True') != 'False'
# If start and end date are not set, we are expecting today's stats.
today = str(datetime.utcnow().date())
start_date = datetime.strptime(request.args.get('start_date', today), '%Y-%m-%d').date()
end_date = datetime.strptime(request.args.get('end_date', today), '%Y-%m-%d').date()
data = fetch_aggregate_stats_by_date_range_for_all_services(start_date=start_date,
end_date=end_date,
include_from_test_key=include_from_test_key
)
stats = statistics.format_statistics(data)
result = jsonify(stats)
return result
@service_blueprint.route('', methods=['GET'])
def get_services():
only_active = request.args.get('only_active') == 'True'