From 063d11a8668e0be873007b339eabe36f6bbb882c Mon Sep 17 00:00:00 2001 From: Zainab Amir Date: Thu, 16 Dec 2021 14:47:52 +0500 Subject: [PATCH] fix: update save_for_later api endpoint (#29620) fix: update save_for_later api endpoint --- lms/djangoapps/save_for_later/api/v1/views.py | 10 ++++++---- lms/envs/common.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/save_for_later/api/v1/views.py b/lms/djangoapps/save_for_later/api/v1/views.py index 873e5eafbb..aa82483aad 100644 --- a/lms/djangoapps/save_for_later/api/v1/views.py +++ b/lms/djangoapps/save_for_later/api/v1/views.py @@ -93,14 +93,15 @@ class SaveForLaterApiView(APIView): 'false&save_for_later=true'.format(base_url=lms_url, course_id=course_key), 'view_course_url': marketing_url + '?save_for_later=true' if marketing_url else '#', 'display_name': course_overview.display_name, + 'pref_lang': request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME, 'en'), 'short_description': course_overview.short_description, } } braze_client = BrazeClient( - api_key=configuration_helpers.get_value('BRAZE_API_KEY'), - api_url=configuration_helpers.get_value('BRAZE_API_URL'), - app_id=configuration_helpers.get_value('BRAZE_APP_ID'), + api_key=configuration_helpers.get_value('EDX_BRAZE_API_KEY'), + api_url=configuration_helpers.get_value('EDX_BRAZE_API_SERVER'), + app_id='', ) try: @@ -122,7 +123,8 @@ class SaveForLaterApiView(APIView): { 'user_id': user.id, 'category': 'save-for-later', - 'type': 'course' if course_id else 'program' + 'type': 'course' if course_id else 'program', + 'send_to_self': bool(not user.is_anonymous and user.email == email), } ) except Exception: # pylint: disable=broad-except diff --git a/lms/envs/common.py b/lms/envs/common.py index 6f6f48ddb6..6754763b57 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4569,7 +4569,7 @@ PASSWORD_RESET_EMAIL_RATE = '2/h' #### SAVE FOR LATER EMAIL RATE LIMIT SETTINGS #### SAVE_FOR_LATER_IP_RATE_LIMIT = '100/d' -SAVE_FOR_LATER_EMAIL_RATE_LIMIT = '5/m' +SAVE_FOR_LATER_EMAIL_RATE_LIMIT = '5/h' ############### Settings for Retirement ##################### # .. setting_name: RETIRED_USERNAME_PREFIX