Commit dd7f09d3 by Justin Helbert

This confirms the data api upgrade

parent 70d47fb5
...@@ -38,8 +38,8 @@ from student.roles import CourseFinanceAdminRole ...@@ -38,8 +38,8 @@ from student.roles import CourseFinanceAdminRole
from bulk_email.models import CourseAuthorization from bulk_email.models import CourseAuthorization
from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem
from analyticsclient.client import RestClient, ClientError from analyticsclient.client import Client
from analyticsclient.course import Course from analyticsclient.exceptions import ClientError
from .tools import get_units_with_due_date, title_or_url, bulk_email_is_enabled_for_course from .tools import get_units_with_due_date, title_or_url, bulk_email_is_enabled_for_course
from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey
...@@ -386,16 +386,17 @@ def _update_active_students(course_key, section_data): ...@@ -386,16 +386,17 @@ def _update_active_students(course_key, section_data):
section_data['active_student_count_end'] = 'N/A' section_data['active_student_count_end'] = 'N/A'
try: try:
client = RestClient(base_url=base_url, auth_token=auth_token) client = Client(base_url=base_url, auth_token=auth_token)
course = Course(client, course_key.to_deprecated_string()) course = client.courses(unicode(course_key))
section_data['active_student_count'] = course.recent_active_user_count['count'] recent_activity = course.recent_activity()
section_data['active_student_count'] = recent_activity['count']
def format_date(value): def format_date(value):
return value.split('T')[0] return value.split('T')[0]
start = course.recent_active_user_count['interval_start'] start = recent_activity['interval_start']
end = course.recent_active_user_count['interval_end'] end = recent_activity['interval_end']
section_data['active_student_count_start'] = format_date(start) section_data['active_student_count_start'] = format_date(start)
section_data['active_student_count_end'] = format_date(end) section_data['active_student_count_end'] = format_date(end)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
-e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool -e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool
-e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle -e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle
-e git+https://github.com/edx/event-tracking.git@0.1.0#egg=event-tracking -e git+https://github.com/edx/event-tracking.git@0.1.0#egg=event-tracking
-e git+https://github.com/edx/edx-analytics-api-client.git@0.1.0#egg=analytics-client -e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client
-e git+https://github.com/edx/bok-choy.git@9162c0bfb8e0eb1e2fa8e6df8dec12d181322a90#egg=bok_choy -e git+https://github.com/edx/bok-choy.git@9162c0bfb8e0eb1e2fa8e6df8dec12d181322a90#egg=bok_choy
-e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash -e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash
-e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock -e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment