From 40386b311d296764ff306fcfcdd47d849988f08e Mon Sep 17 00:00:00 2001 From: Douglas Hall Date: Thu, 2 Jun 2016 17:00:03 -0400 Subject: [PATCH 1/3] Fix student profile data download for courses with extended profile fields --- lms/djangoapps/instructor_task/api.py | 2 +- lms/djangoapps/instructor_task/tasks_helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/instructor_task/api.py b/lms/djangoapps/instructor_task/api.py index 6591202d63..26352f0bf4 100644 --- a/lms/djangoapps/instructor_task/api.py +++ b/lms/djangoapps/instructor_task/api.py @@ -337,7 +337,7 @@ def submit_calculate_students_features_csv(request, course_key, features): """ task_type = 'profile_info_csv' task_class = calculate_students_features_csv - task_input = {'features': features} + task_input = features task_key = "" return submit_task(request, task_type, task_class, course_key, task_input, task_key) diff --git a/lms/djangoapps/instructor_task/tasks_helper.py b/lms/djangoapps/instructor_task/tasks_helper.py index c276d6de90..43f97ad9b9 100644 --- a/lms/djangoapps/instructor_task/tasks_helper.py +++ b/lms/djangoapps/instructor_task/tasks_helper.py @@ -996,7 +996,7 @@ def upload_students_csv(_xmodule_instance_args, _entry_id, course_id, task_input task_progress.update_task_state(extra_meta=current_step) # compute the student features table and format it - query_features = task_input.get('features') + query_features = task_input student_data = enrolled_students_features(course_id, query_features) header, rows = format_dictlist(student_data, query_features) From ea654200f58936ed9467070a948ed6464940ed76 Mon Sep 17 00:00:00 2001 From: Douglas Hall Date: Thu, 2 Jun 2016 14:15:26 -0400 Subject: [PATCH 2/3] Put shopping cart bulk purchase behind a settings flag --- lms/djangoapps/instructor/views/api.py | 11 +++++++++-- lms/djangoapps/shoppingcart/views.py | 1 + lms/templates/shoppingcart/shopping_cart.html | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 26014efc12..ca68e24190 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -1240,8 +1240,15 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red available_features = instructor_analytics.basic.AVAILABLE_FEATURES - # Allow for microsites to be able to define additional columns (e.g. ) - query_features = microsite.get_value('student_profile_download_fields') + # Allow for microsites to be able to define additional columns. + # Note that adding additional columns has the potential to break + # the student profile report due to a character limit on the + # asynchronous job input which in this case is a JSON string + # containing the list of columns to include in the report. + # TODO: Refactor the student profile report code to remove the list of columns + # that should be included in the report from the asynchronous job input. + # We need to clone the list because we modify it below + query_features = list(microsite.get_value('student_profile_download_fields', [])) if not query_features: query_features = [ diff --git a/lms/djangoapps/shoppingcart/views.py b/lms/djangoapps/shoppingcart/views.py index f9d7f7f6fa..771b1551c9 100644 --- a/lms/djangoapps/shoppingcart/views.py +++ b/lms/djangoapps/shoppingcart/views.py @@ -190,6 +190,7 @@ def show_cart(request): 'form_html': form_html, 'currency_symbol': settings.PAID_COURSE_REGISTRATION_CURRENCY[1], 'currency': settings.PAID_COURSE_REGISTRATION_CURRENCY[0], + 'enable_bulk_purchase': microsite.get_value('ENABLE_SHOPPING_CART_BULK_PURCHASE', True) } return render_to_response("shoppingcart/shopping_cart.html", context) diff --git a/lms/templates/shoppingcart/shopping_cart.html b/lms/templates/shoppingcart/shopping_cart.html index 4f29e9017f..a39cfbb4c7 100644 --- a/lms/templates/shoppingcart/shopping_cart.html +++ b/lms/templates/shoppingcart/shopping_cart.html @@ -101,6 +101,7 @@ from openedx.core.lib.courses import course_image_url % endif
+ % if enable_bulk_purchase:
@@ -116,8 +117,9 @@ from openedx.core.lib.courses import course_image_url -
+ % endif +