Fix problems that drf-yasg uncovered.
These were originally fixed individually, but had to be reverted, and are now combined in one commit. The originals were:7b9040f6b0This enum was backwards8774ff1f9bUse ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same.8a44397139Is this field missing because it is None?4a1154a7caGive a safer buffer for clearing the rate limiting64c47856ddDRF 3.7.4 changed how you delegate to another view, so don't7359ca4fb2Is this right? It fixes two testsfdd66e5390Adjust the expected error message for DRF 3.7.79257f68fd8The default TIME_ZONE should be UTC
This commit is contained in:
@@ -61,6 +61,7 @@ from openedx.core.djangoapps.django_comment_common.signals import (
|
||||
thread_voted
|
||||
)
|
||||
from openedx.core.djangoapps.django_comment_common.utils import get_course_discussion_settings
|
||||
from openedx.core.djangoapps.user_api.accounts.api import get_account_settings
|
||||
from openedx.core.djangoapps.user_api.accounts.views import AccountViewSet
|
||||
from openedx.core.lib.exceptions import CourseNotFoundError, DiscussionNotFoundError, PageNotFoundError
|
||||
|
||||
@@ -365,10 +366,11 @@ def _get_user_profile_dict(request, usernames):
|
||||
|
||||
A dict with username as key and user profile details as value.
|
||||
"""
|
||||
request.GET = request.GET.copy() # Make a mutable copy of the GET parameters.
|
||||
request.GET['username'] = usernames
|
||||
user_profile_details = AccountViewSet.as_view({'get': 'list'})(request).data
|
||||
|
||||
if usernames:
|
||||
username_list = usernames.split(",")
|
||||
else:
|
||||
username_list = []
|
||||
user_profile_details = get_account_settings(request, username_list)
|
||||
return {user['username']: user for user in user_profile_details}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user