Skip to content

Commit d96dd9b

Browse files
authored
Merge pull request #219 from appsembler/john/fix-course-completion
Fixes incorrect site monthly metrics course completion data
2 parents 8a542aa + 0774b69 commit d96dd9b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

figures/metrics.py

+1
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ def get_total_site_users_joined_for_time_period(site, start_date, end_date,
346346
"""returns the number of new enrollments for the time period
347347
348348
NOTE: Untested and not yet used in the general site metrics, but we'll want to add it
349+
TODO: Rename this function to be "new_users" for consistency with the API endpoint
349350
"""
350351
def calc_from_user_model():
351352
filter_args = dict(

figures/views.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,9 @@ def registered_users(self, request):
565565

566566
@list_route()
567567
def new_users(self, request):
568+
"""
569+
TODO: Rename the metrics module function to "new_users" to match this
570+
"""
568571
site = django.contrib.sites.shortcuts.get_current_site(self.request)
569572
date_for = datetime.utcnow().date()
570573
months_back = 6
@@ -585,7 +588,7 @@ def course_completions(self, request):
585588
months_back = 6
586589

587590
course_completions = metrics.get_monthly_history_metric(
588-
func=metrics.get_total_site_users_for_time_period,
591+
func=metrics.get_total_course_completions_for_time_period,
589592
site=site,
590593
date_for=date_for,
591594
months_back=months_back,

0 commit comments

Comments
 (0)