diff --git a/analytics_data_api/v0/models.py b/analytics_data_api/v0/models.py index 9bb7ef6e..b7cccc69 100644 --- a/analytics_data_api/v0/models.py +++ b/analytics_data_api/v0/models.py @@ -336,7 +336,7 @@ def get_users_in_course( search.query.must.append(Q('multi_match', query=text_search, fields=['name', 'username', 'email'])) # construct the sort hierarchy - search = search.sort(*[ + search_request = search.sort(*[ { sort_policy['order_by']: { 'order': sort_policy['sort_order'], @@ -347,7 +347,7 @@ def get_users_in_course( for sort_policy in sort_policies ]) - return search + return search_request @classmethod def get_course_metadata(cls, course_id): diff --git a/analytics_data_api/v0/tests/views/test_learners.py b/analytics_data_api/v0/tests/views/test_learners.py index a7775980..6adcccd0 100644 --- a/analytics_data_api/v0/tests/views/test_learners.py +++ b/analytics_data_api/v0/tests/views/test_learners.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + import copy import datetime from itertools import groupby @@ -272,6 +274,7 @@ def test_data(self): ('cohort', 'a', 'cohort', 'a', True), ('cohort', 'a', 'cohort', '', True), ('cohort', 'a', 'cohort', 'b', False), + ('cohort', u'Ich möchte Brot zu essen.', 'cohort', u'Ich möchte Brot zu essen.', True), ('enrollment_mode', 'a', 'enrollment_mode', 'a', True), ('enrollment_mode', 'a', 'enrollment_mode', '', True), ('enrollment_mode', 'a', 'enrollment_mode', 'b', False), diff --git a/requirements/base.txt b/requirements/base.txt index 4d03b05a..34d8aede 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -5,7 +5,7 @@ djangorestframework==2.4.4 # BSD django-rest-swagger==0.2.8 # BSD djangorestframework-csv==1.3.3 # BSD django-countries==3.2 # MIT -elasticsearch-dsl==0.0.9 # Apache 2.0 +elasticsearch-dsl==0.0.11 # Apache 2.0 # markdown is used by swagger for rendering the api docs Markdown==2.6 # BSD