From 3b63394326ca70390174013cf2c47a8d3d116c14 Mon Sep 17 00:00:00 2001 From: wondrousWebWorks Date: Mon, 29 May 2023 09:47:42 +0200 Subject: [PATCH 1/5] Modify Zoho query to filter by credit rating body --- lms/djangoapps/student_enrollment/zoho.py | 13 ++++++++----- lms/envs/production.py | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/student_enrollment/zoho.py b/lms/djangoapps/student_enrollment/zoho.py index b08f3d9256..fc405b1b31 100644 --- a/lms/djangoapps/student_enrollment/zoho.py +++ b/lms/djangoapps/student_enrollment/zoho.py @@ -17,7 +17,7 @@ SELECT Email, Full_Name, Programme_ID, Student_Source FROM Contacts WHERE (( - (Lead_Status = 'Enroll') AND (Programme_ID is not null) + (Credit_Rating_Body = {credit_rating_body}) AND (Lead_Status = 'Enroll') AND (Programme_ID is not null) ) AND ( (LMS_Version = 'Upgrade to Juniper') OR (LMS_Version = 'Juniper (learn.codeinstitute.net)') @@ -30,7 +30,7 @@ SELECT Email, Full_Name, Programme_ID FROM Contacts WHERE (( - (LMS_Access_Status = 'To be removed') AND (Reason_for_Unenrollment is not null) + (Credit_Rating_Body = {credit_rating_body}) AND (LMS_Access_Status = 'To be removed') AND (Reason_for_Unenrollment is not null) ) AND ( (Programme_ID is not null) AND (LMS_Version = 'Juniper (learn.codeinstitute.net)') @@ -42,7 +42,7 @@ ENROLL_SPECIALISATION_QUERY = """ SELECT Email, Full_Name, Programme_ID, Specialisation_programme_id, Specialization_Enrollment_Date, Specialisation_Change_Requested_Within_7_Days FROM Contacts -WHERE (Specialisation_Enrollment_Status = 'Approved') AND (Specialisation_programme_id is not null) +WHERE (Credit_Rating_Body = {credit_rating_body}) AND (Specialisation_Enrollment_Status = 'Approved') AND (Specialisation_programme_id is not null) LIMIT {page},{per_page} """ @@ -71,7 +71,8 @@ def get_students_to_be_enrolled(): for page in count(): query = ENROLL_QUERY.format( page=page*RECORDS_PER_PAGE, - per_page=RECORDS_PER_PAGE) + per_page=RECORDS_PER_PAGE, + credit_rating_body=settings.LMS_CREDIT_RATING_BODY) students_resp = requests.post( COQL_ENDPOINT, headers=auth_headers, @@ -97,6 +98,7 @@ def get_students_to_be_enrolled_into_specialisation(): query = ENROLL_SPECIALISATION_QUERY.format( page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE, + credit_rating_body=settings.LMS_CREDIT_RATING_BODY ) students_resp = requests.post( COQL_ENDPOINT, @@ -123,7 +125,8 @@ def get_students_to_be_unenrolled(): for page in count(): query = UNENROLL_QUERY.format( page=page*RECORDS_PER_PAGE, - per_page=RECORDS_PER_PAGE) + per_page=RECORDS_PER_PAGE, + credit_rating_body=settings.LMS_CREDIT_RATING_BODY) students_resp = requests.post( COQL_ENDPOINT, headers=auth_headers, diff --git a/lms/envs/production.py b/lms/envs/production.py index bae358f264..69fae0a983 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -1024,6 +1024,7 @@ def should_show_debug_toolbar(request): sentry_sdk.init(dsn=SENTRY_DSN, integrations=[DjangoIntegration()]) # CodeInstitute +LMS_CREDIT_RATING_BODY = AUTH_TOKENS.get('LMS_CREDIT_RATING_BODY') HUBSPOT_CONTACTS_ENDPOINT = AUTH_TOKENS.get('HUBSPOT_CONTACTS_ENDPOINT') HUBSPOT_API_KEY = AUTH_TOKENS.get('HUBSPOT_API_KEY') From a75e35fef2dd8a599ca95c50fabac0c0cbca6da8 Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 29 May 2023 17:01:11 +0200 Subject: [PATCH 2/5] Fix COQL query syntax; add lms_platform k-v pair to Exception Zap JSON --- .../student_enrollment/enrollment.py | 6 ++ .../student_enrollment/unenrollment.py | 4 ++ lms/djangoapps/student_enrollment/zoho.py | 56 +++++++++++-------- 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/lms/djangoapps/student_enrollment/enrollment.py b/lms/djangoapps/student_enrollment/enrollment.py index ec52472ed4..685e3447a5 100644 --- a/lms/djangoapps/student_enrollment/enrollment.py +++ b/lms/djangoapps/student_enrollment/enrollment.py @@ -28,6 +28,8 @@ initial student onboarding/enrollment process like the Careers module. """ EXCLUDED_FROM_ONBOARDING = ['course-v1:code_institute+cc_101+2018_T1'] +LMS_PLATFORM = settings.LMS_CREDIT_RATING_BODY + today = date.today().isoformat() @@ -85,6 +87,7 @@ def enroll(self): 'email': student['Email'], 'crm_field': 'Programme_ID', 'unexpected_value': student['Programme_ID'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'enroll', 'message': 'Programme ID does not exist on LMS' } @@ -219,6 +222,7 @@ def enroll(self): 'email': student['Email'], 'crm_field': 'Specialisation_programme_id', 'unexpected_value': student['Specialisation_programme_id'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'enroll specialisation', 'message': ('Student is already enrolled into this specialisation') } @@ -238,6 +242,7 @@ def enroll(self): 'email': student['Email'], 'crm_field': 'Specialisation_programme_id', 'unexpected_value': student['Specialisation_programme_id'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'enroll specialisation', 'message': 'Specialisation programme ID does not exist on LMS' } @@ -268,6 +273,7 @@ def enroll(self): 'email': student['Email'], 'crm_field': 'Specialisation_programme_id', 'unexpected_value': student['Specialisation_programme_id'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'enroll specialisation', 'message': ('Specialisation change field checked, but student' + ' is already enrolled into the same specialisation') diff --git a/lms/djangoapps/student_enrollment/unenrollment.py b/lms/djangoapps/student_enrollment/unenrollment.py index 8882a5411d..055bde90bc 100644 --- a/lms/djangoapps/student_enrollment/unenrollment.py +++ b/lms/djangoapps/student_enrollment/unenrollment.py @@ -13,6 +13,8 @@ log = getLogger(__name__) +LMS_PLATFORM = settings.LMS_CREDIT_RATING_BODY + class Unenrollment: ''' Unenroll students from their relevant programs @@ -59,6 +61,7 @@ def unenroll(self): 'email': student['Email'], 'crm_field': 'Email', 'unexpected_value': student['Email'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'unenroll', 'message': 'Email on Student\'s CRM profile not found on LMS' } @@ -78,6 +81,7 @@ def unenroll(self): 'email': student['Email'], 'crm_field': 'Programme_ID', 'unexpected_value': student['Programme_ID'], + 'lms_platform': LMS_PLATFORM, 'attempted_action': 'unenroll', 'message': 'Programme ID does not exist on LMS' } diff --git a/lms/djangoapps/student_enrollment/zoho.py b/lms/djangoapps/student_enrollment/zoho.py index fc405b1b31..1d927564a3 100644 --- a/lms/djangoapps/student_enrollment/zoho.py +++ b/lms/djangoapps/student_enrollment/zoho.py @@ -8,44 +8,53 @@ REFRESH_TOKEN = settings.ZOHO_REFRESH_TOKEN REFRESH_ENDPOINT = settings.ZOHO_REFRESH_ENDPOINT COQL_ENDPOINT = settings.ZOHO_COQL_ENDPOINT +CREDIT_RATING_BODY = settings.LMS_CREDIT_RATING_BODY # COQL Queries -# LMS_Version can be removed from where clause when Ginkgo is decommissioned -# Target decommission date: End of Q1 2020 +# NOTE: "Excessive" parentheses added because Zoho COQL requires every subsequent +# chained condition to be wrapped in separate parentheses e.g. (A AND (B AND (C OR D))) +# otherwise a Syntax Error is received ENROLL_QUERY = """ SELECT Email, Full_Name, Programme_ID, Student_Source FROM Contacts -WHERE (( - (Credit_Rating_Body = {credit_rating_body}) AND (Lead_Status = 'Enroll') AND (Programme_ID is not null) - ) +WHERE ( + Credit_Rating_Body = '{credit_rating_body}' AND ( - (LMS_Version = 'Upgrade to Juniper') OR (LMS_Version = 'Juniper (learn.codeinstitute.net)') - ) -) + Lead_Status = 'Enroll' + AND ( + Programme_ID is not null +))) LIMIT {page},{per_page} """ UNENROLL_QUERY = """ SELECT Email, Full_Name, Programme_ID FROM Contacts -WHERE (( - (Credit_Rating_Body = {credit_rating_body}) AND (LMS_Access_Status = 'To be removed') AND (Reason_for_Unenrollment is not null) - ) +WHERE ( + Credit_Rating_Body = '{credit_rating_body}' AND ( - (Programme_ID is not null) AND (LMS_Version = 'Juniper (learn.codeinstitute.net)') - ) -) + LMS_Access_Status = 'To be removed' + AND ( + Reason_for_Unenrollment is not null +))) LIMIT {page},{per_page} """ ENROLL_SPECIALISATION_QUERY = """ SELECT Email, Full_Name, Programme_ID, Specialisation_programme_id, Specialization_Enrollment_Date, Specialisation_Change_Requested_Within_7_Days FROM Contacts -WHERE (Credit_Rating_Body = {credit_rating_body}) AND (Specialisation_Enrollment_Status = 'Approved') AND (Specialisation_programme_id is not null) +WHERE ( + Credit_Rating_Body = '{credit_rating_body}' + AND ( + Specialisation_Enrollment_Status = 'Approved' + AND ( + Specialisation_programme_id is not null +))) LIMIT {page},{per_page} """ +# Currently not used - Careers enrolment handled by CRM + Zapier automation ENROLL_IN_CAREERS_MODULE_QUERY = """ SELECT Email, Full_Name, Programme_ID FROM Contacts @@ -70,9 +79,10 @@ def get_students_to_be_enrolled(): for page in count(): query = ENROLL_QUERY.format( - page=page*RECORDS_PER_PAGE, - per_page=RECORDS_PER_PAGE, - credit_rating_body=settings.LMS_CREDIT_RATING_BODY) + credit_rating_body=CREDIT_RATING_BODY, + page=page*RECORDS_PER_PAGE, + per_page=RECORDS_PER_PAGE + ) students_resp = requests.post( COQL_ENDPOINT, headers=auth_headers, @@ -96,9 +106,9 @@ def get_students_to_be_enrolled_into_specialisation(): for page in count(): query = ENROLL_SPECIALISATION_QUERY.format( + credit_rating_body=CREDIT_RATING_BODY, page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE, - credit_rating_body=settings.LMS_CREDIT_RATING_BODY ) students_resp = requests.post( COQL_ENDPOINT, @@ -124,9 +134,10 @@ def get_students_to_be_unenrolled(): for page in count(): query = UNENROLL_QUERY.format( - page=page*RECORDS_PER_PAGE, - per_page=RECORDS_PER_PAGE, - credit_rating_body=settings.LMS_CREDIT_RATING_BODY) + credit_rating_body=CREDIT_RATING_BODY, + page=page*RECORDS_PER_PAGE, + per_page=RECORDS_PER_PAGE, + ) students_resp = requests.post( COQL_ENDPOINT, headers=auth_headers, @@ -139,6 +150,7 @@ def get_students_to_be_unenrolled(): return students +# Currently not used def get_students_to_be_enrolled_in_careers_module(): """Fetch from Zoho all students with the Access_to_Careers_Module status From 4033d15c32c8cf7fb461cbc4f03664902b450015 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 31 May 2023 09:17:40 +0200 Subject: [PATCH 3/5] Send SITE_NAME (instead of provider name) in Zapier webhook --- lms/djangoapps/student_enrollment/enrollment.py | 2 +- lms/djangoapps/student_enrollment/unenrollment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/student_enrollment/enrollment.py b/lms/djangoapps/student_enrollment/enrollment.py index 685e3447a5..042d4b4768 100644 --- a/lms/djangoapps/student_enrollment/enrollment.py +++ b/lms/djangoapps/student_enrollment/enrollment.py @@ -28,7 +28,7 @@ initial student onboarding/enrollment process like the Careers module. """ EXCLUDED_FROM_ONBOARDING = ['course-v1:code_institute+cc_101+2018_T1'] -LMS_PLATFORM = settings.LMS_CREDIT_RATING_BODY +LMS_PLATFORM = settings.SITE_NAME today = date.today().isoformat() diff --git a/lms/djangoapps/student_enrollment/unenrollment.py b/lms/djangoapps/student_enrollment/unenrollment.py index 055bde90bc..15a3c695eb 100644 --- a/lms/djangoapps/student_enrollment/unenrollment.py +++ b/lms/djangoapps/student_enrollment/unenrollment.py @@ -13,7 +13,7 @@ log = getLogger(__name__) -LMS_PLATFORM = settings.LMS_CREDIT_RATING_BODY +LMS_PLATFORM = settings.SITE_NAME class Unenrollment: From 67a63cd0627e482bad341821ed839a57306f302f Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 31 May 2023 12:24:59 +0200 Subject: [PATCH 4/5] Modify COQL query to cater for multiple providers --- lms/djangoapps/student_enrollment/zoho.py | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/student_enrollment/zoho.py b/lms/djangoapps/student_enrollment/zoho.py index 1d927564a3..3691661896 100644 --- a/lms/djangoapps/student_enrollment/zoho.py +++ b/lms/djangoapps/student_enrollment/zoho.py @@ -8,7 +8,24 @@ REFRESH_TOKEN = settings.ZOHO_REFRESH_TOKEN REFRESH_ENDPOINT = settings.ZOHO_REFRESH_ENDPOINT COQL_ENDPOINT = settings.ZOHO_COQL_ENDPOINT -CREDIT_RATING_BODY = settings.LMS_CREDIT_RATING_BODY + +CREDIT_RATING_BODY_LIST = settings.LMS_CREDIT_RATING_BODY + +# NOTE: ZOHO COQL's IN operator requires a comma-separated sequence of strings, either wrapped +# in () or without any wrapping. Formatting a JSON array (from settings) into a COQL-acceptable format (no [] allowed) +# with Python requires either a simple string (for a single-element array) or a tuple (for multiple elements). +# If a tuple is used for a one-element array, it results in an (X,) format, which triggers a COQL query error. +# On the other hand, if the single element is injected into the query as a simple string, it "loses" its wrapping quotes, +# which again triggers a COQL query error. +# +# Hence the solution: +# - for single-element array, index the single element, and wrap it into parentheses AND quotes before injecting it +# - for multiple-element array, convert it into a tuple (of strings) and inject it + +if len(CREDIT_RATING_BODY_LIST) == 1: + CREDIT_RATING_BODY = '(\'{}\')'.format(CREDIT_RATING_BODY_LIST[0]) +else: + CREDIT_RATING_BODY = tuple(CREDIT_RATING_BODY_LIST) # COQL Queries # NOTE: "Excessive" parentheses added because Zoho COQL requires every subsequent @@ -19,7 +36,7 @@ SELECT Email, Full_Name, Programme_ID, Student_Source FROM Contacts WHERE ( - Credit_Rating_Body = '{credit_rating_body}' + Credit_Rating_Body in {credit_rating_body} AND ( Lead_Status = 'Enroll' AND ( @@ -32,7 +49,7 @@ SELECT Email, Full_Name, Programme_ID FROM Contacts WHERE ( - Credit_Rating_Body = '{credit_rating_body}' + Credit_Rating_Body in {credit_rating_body} AND ( LMS_Access_Status = 'To be removed' AND ( @@ -45,7 +62,7 @@ SELECT Email, Full_Name, Programme_ID, Specialisation_programme_id, Specialization_Enrollment_Date, Specialisation_Change_Requested_Within_7_Days FROM Contacts WHERE ( - Credit_Rating_Body = '{credit_rating_body}' + Credit_Rating_Body in {credit_rating_body} AND ( Specialisation_Enrollment_Status = 'Approved' AND ( @@ -83,6 +100,7 @@ def get_students_to_be_enrolled(): page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE ) + students_resp = requests.post( COQL_ENDPOINT, headers=auth_headers, From 4eac48c7c551a92c952eefbfc5e0a775b7ace810 Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 1 Jun 2023 17:01:21 +0200 Subject: [PATCH 5/5] Make CRM eligibility field selection customisable; fix env call --- .../student_enrollment/enrollment.py | 5 +++- .../student_enrollment/unenrollment.py | 4 +++- lms/djangoapps/student_enrollment/zoho.py | 24 +++++++++++-------- lms/envs/common.py | 13 ++++++++++ lms/envs/production.py | 3 ++- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/lms/djangoapps/student_enrollment/enrollment.py b/lms/djangoapps/student_enrollment/enrollment.py index 042d4b4768..f3430bfa4a 100644 --- a/lms/djangoapps/student_enrollment/enrollment.py +++ b/lms/djangoapps/student_enrollment/enrollment.py @@ -28,7 +28,10 @@ initial student onboarding/enrollment process like the Careers module. """ EXCLUDED_FROM_ONBOARDING = ['course-v1:code_institute+cc_101+2018_T1'] -LMS_PLATFORM = settings.SITE_NAME + +# the only reliable way to get the output ".codeinstitute[-platform].net" +# required for the enrolment exception Zaps +LMS_PLATFORM = settings.FEATURES["PREVIEW_LMS_BASE"].split("preview.")[1] today = date.today().isoformat() diff --git a/lms/djangoapps/student_enrollment/unenrollment.py b/lms/djangoapps/student_enrollment/unenrollment.py index 15a3c695eb..7e27289729 100644 --- a/lms/djangoapps/student_enrollment/unenrollment.py +++ b/lms/djangoapps/student_enrollment/unenrollment.py @@ -13,7 +13,9 @@ log = getLogger(__name__) -LMS_PLATFORM = settings.SITE_NAME +# the only reliable way to get the output ".codeinstitute[-platform].net" +# required for the enrolment exception Zaps +LMS_PLATFORM = settings.FEATURES["PREVIEW_LMS_BASE"].split("preview.")[1] class Unenrollment: diff --git a/lms/djangoapps/student_enrollment/zoho.py b/lms/djangoapps/student_enrollment/zoho.py index 3691661896..c74153b28b 100644 --- a/lms/djangoapps/student_enrollment/zoho.py +++ b/lms/djangoapps/student_enrollment/zoho.py @@ -9,7 +9,8 @@ REFRESH_ENDPOINT = settings.ZOHO_REFRESH_ENDPOINT COQL_ENDPOINT = settings.ZOHO_COQL_ENDPOINT -CREDIT_RATING_BODY_LIST = settings.LMS_CREDIT_RATING_BODY +LMS_CRM_ELIGIBILITY_KEY = settings.LMS_CRM_STUDENT_ELIGIBILITY_FIELD +LMS_CRM_ELIGIBLE_VALUES = settings.LMS_CRM_STUDENT_ELIGIBILITY_FIELD_VALUES # NOTE: ZOHO COQL's IN operator requires a comma-separated sequence of strings, either wrapped # in () or without any wrapping. Formatting a JSON array (from settings) into a COQL-acceptable format (no [] allowed) @@ -22,10 +23,10 @@ # - for single-element array, index the single element, and wrap it into parentheses AND quotes before injecting it # - for multiple-element array, convert it into a tuple (of strings) and inject it -if len(CREDIT_RATING_BODY_LIST) == 1: - CREDIT_RATING_BODY = '(\'{}\')'.format(CREDIT_RATING_BODY_LIST[0]) +if len(LMS_CRM_ELIGIBLE_VALUES) == 1: + LMS_CRM_ELIGIBLE_VALUES = '(\'{}\')'.format(LMS_CRM_ELIGIBLE_VALUES[0]) else: - CREDIT_RATING_BODY = tuple(CREDIT_RATING_BODY_LIST) + LMS_CRM_ELIGIBLE_VALUES = tuple(LMS_CRM_ELIGIBLE_VALUES) # COQL Queries # NOTE: "Excessive" parentheses added because Zoho COQL requires every subsequent @@ -36,7 +37,7 @@ SELECT Email, Full_Name, Programme_ID, Student_Source FROM Contacts WHERE ( - Credit_Rating_Body in {credit_rating_body} + {crm_eligibility_key} in {eligible_values} AND ( Lead_Status = 'Enroll' AND ( @@ -49,7 +50,7 @@ SELECT Email, Full_Name, Programme_ID FROM Contacts WHERE ( - Credit_Rating_Body in {credit_rating_body} + {crm_eligibility_key} in {eligible_values} AND ( LMS_Access_Status = 'To be removed' AND ( @@ -62,7 +63,7 @@ SELECT Email, Full_Name, Programme_ID, Specialisation_programme_id, Specialization_Enrollment_Date, Specialisation_Change_Requested_Within_7_Days FROM Contacts WHERE ( - Credit_Rating_Body in {credit_rating_body} + {crm_eligibility_key} in {eligible_values} AND ( Specialisation_Enrollment_Status = 'Approved' AND ( @@ -96,7 +97,8 @@ def get_students_to_be_enrolled(): for page in count(): query = ENROLL_QUERY.format( - credit_rating_body=CREDIT_RATING_BODY, + crm_eligibility_key=LMS_CRM_ELIGIBILITY_KEY, + eligible_values=LMS_CRM_ELIGIBLE_VALUES, page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE ) @@ -124,7 +126,8 @@ def get_students_to_be_enrolled_into_specialisation(): for page in count(): query = ENROLL_SPECIALISATION_QUERY.format( - credit_rating_body=CREDIT_RATING_BODY, + crm_eligibility_key=LMS_CRM_ELIGIBILITY_KEY, + eligible_values=LMS_CRM_ELIGIBLE_VALUES, page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE, ) @@ -152,7 +155,8 @@ def get_students_to_be_unenrolled(): for page in count(): query = UNENROLL_QUERY.format( - credit_rating_body=CREDIT_RATING_BODY, + crm_eligibility_key=LMS_CRM_ELIGIBILITY_KEY, + eligible_values=LMS_CRM_ELIGIBLE_VALUES, page=page*RECORDS_PER_PAGE, per_page=RECORDS_PER_PAGE, ) diff --git a/lms/envs/common.py b/lms/envs/common.py index 1f92b6f221..cbd76e560b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3955,3 +3955,16 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring AMOS_HOST = os.environ.get('AMOS_HOST') AMOS_PORT = int(os.environ.get('AMOS_PORT', 3306)) AMOS_DB = os.environ.get('AMOS_DB') + + +ZOHO_CLIENT_ID = os.environ.get('ZOHO_CLIENT_ID') +ZOHO_CLIENT_SECRET = os.environ.get('ZOHO_CLIENT_SECRET') +ZOHO_REFRESH_TOKEN = os.environ.get('ZOHO_REFRESH_TOKEN') +ZOHO_REFRESH_ENDPOINT = os.environ.get('ZOHO_REFRESH_ENDPOINT') +ZOHO_STUDENTS_ENDPOINT = os.environ.get('ZOHO_STUDENTS_ENDPOINT') +ZOHO_MENTORS_ENDPOINT = os.environ.get('ZOHO_MENTORS_ENDPOINT') +ZOHO_TIMEOUT_SECONDS = os.environ.get('ZOHO_TIMEOUT_SECONDS', 0.5) +ZOHO_COQL_ENDPOINT = os.environ.get('ZOHO_COQL_ENDPOINT') + +LMS_CRM_STUDENT_ELIGIBILITY_FIELD = os.environ.get('LMS_CRM_STUDENT_ELIGIBILITY_FIELD', 'Credit_Rating_Body') +LMS_CRM_STUDENT_ELIGIBILITY_FIELD_VALUES = os.environ.get('LMS_CRM_STUDENT_ELIGIBILITY_FIELD_VALUES') diff --git a/lms/envs/production.py b/lms/envs/production.py index 69fae0a983..5d963cf9e0 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -1024,7 +1024,8 @@ def should_show_debug_toolbar(request): sentry_sdk.init(dsn=SENTRY_DSN, integrations=[DjangoIntegration()]) # CodeInstitute -LMS_CREDIT_RATING_BODY = AUTH_TOKENS.get('LMS_CREDIT_RATING_BODY') +LMS_CRM_STUDENT_ELIGIBILITY_FIELD = AUTH_TOKENS.get('LMS_CRM_STUDENT_ELIGIBILITY_FIELD', 'Credit_Rating_Body') +LMS_CRM_STUDENT_ELIGIBILITY_FIELD_VALUES = AUTH_TOKENS.get('LMS_CRM_STUDENT_ELIGIBILITY_FIELD_VALUES') HUBSPOT_CONTACTS_ENDPOINT = AUTH_TOKENS.get('HUBSPOT_CONTACTS_ENDPOINT') HUBSPOT_API_KEY = AUTH_TOKENS.get('HUBSPOT_API_KEY')