code style changed

This commit is contained in:
venusbb
2017-09-15 15:00:13 +01:00
parent 478858a1b3
commit 13c78d9b9d
2 changed files with 8 additions and 5 deletions

View File

@@ -367,7 +367,8 @@ def dao_fetch_todays_stats_for_all_services(include_from_test_key=True, trial_mo
Notification.status,
Notification.service_id,
func.count(Notification.id).label('count')
).join(Service
).join(
Service
).filter(
func.date(Notification.created_at) == date.today(),
Service.restricted == trial_mode_services

View File

@@ -94,8 +94,9 @@ def get_services():
services = dao_fetch_all_services_by_user(user_id, only_active)
elif detailed:
result = jsonify(data=get_detailed_services(start_date=start_date, end_date=end_date,
only_active=only_active, include_from_test_key=include_from_test_key,
trial_mode_services = trial_mode_services
only_active=only_active,
include_from_test_key=include_from_test_key,
trial_mode_services=trial_mode_services
))
return result
else:
@@ -361,7 +362,8 @@ def get_detailed_services(start_date, end_date, only_active=False, include_from_
trial_mode_services=True):
services = {service.id: service for service in dao_fetch_all_services(only_active)}
if start_date == datetime.utcnow().date():
stats = dao_fetch_todays_stats_for_all_services(include_from_test_key=include_from_test_key, trial_mode_services=trial_mode_services)
stats = dao_fetch_todays_stats_for_all_services(include_from_test_key=include_from_test_key,
trial_mode_services=trial_mode_services)
else:
stats = fetch_stats_by_date_range_for_all_services(start_date=start_date,