Skip to content

Commit

Permalink
fix!: fix ENV_TOKENS error
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood committed Sep 11, 2023
1 parent 9496e19 commit f35b981
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
12 changes: 3 additions & 9 deletions openedx/core/djangoapps/course_live/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,9 @@ def get_global_keys() -> Dict:
"""
try:
COURSE_LIVE_GLOBAL_CREDENTIALS = {
"KEY": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_KEY", settings.ZOOM_BUTTON_GLOBAL_KEY
),
"SECRET": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_SECRET", settings.ZOOM_BUTTON_GLOBAL_SECRET
),
"URL": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_URL", settings.ZOOM_BUTTON_GLOBAL_URL
),
"KEY": settings.ZOOM_BUTTON_GLOBAL_KEY,
"SECRET": settings.ZOOM_BUTTON_GLOBAL_SECRET,
"URL": settings.ZOOM_BUTTON_GLOBAL_URL,
}
return COURSE_LIVE_GLOBAL_CREDENTIALS
except AttributeError:
Expand Down
28 changes: 7 additions & 21 deletions openedx/core/djangoapps/course_live/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ def is_zoom_creds_global(serialized_data):
.get("additional_parameters", {})
.get("custom_instructor_email", "")
)
global_key = settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_SECRET", settings.ZOOM_BUTTON_GLOBAL_KEY
)
global_url = settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_URL", settings.ZOOM_BUTTON_GLOBAL_URL
)
global_email = settings.ENV_TOKENS.get(
"ZOOM_INSTRUCTOR_EMAIL", settings.ZOOM_INSTRUCTOR_EMAIL
)
global_key = settings.ZOOM_BUTTON_GLOBAL_KEY
global_url = settings.ZOOM_BUTTON_GLOBAL_URL
global_email = settings.ZOOM_INSTRUCTOR_EMAIL
if key == global_key and url == global_url and email == global_email:
return True
return False
Expand Down Expand Up @@ -330,20 +324,12 @@ def post(self, request, course_id: str) -> Response:
"""
request.data["enabled"] = True
request.data["lti_configuration"] = {
"lti_1p1_client_key": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_KEY", settings.ZOOM_BUTTON_GLOBAL_KEY
),
"lti_1p1_client_secret": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_SECRET", settings.ZOOM_BUTTON_GLOBAL_SECRET
),
"lti_1p1_launch_url": settings.ENV_TOKENS.get(
"ZOOM_BUTTON_GLOBAL_URL", settings.ZOOM_BUTTON_GLOBAL_URL
),
"lti_1p1_client_key": settings.ZOOM_BUTTON_GLOBAL_KEY,
"lti_1p1_client_secret": settings.ZOOM_BUTTON_GLOBAL_SECRET,
"lti_1p1_launch_url": settings.ZOOM_BUTTON_GLOBAL_URL,
"lti_config": {
"additional_parameters": {
"custom_instructor_email": settings.ENV_TOKENS.get(
"ZOOM_INSTRUCTOR_EMAIL", settings.ZOOM_INSTRUCTOR_EMAIL
),
"custom_instructor_email": settings.ZOOM_INSTRUCTOR_EMAIL,
}
},
"version": "lti_1p1",
Expand Down

0 comments on commit f35b981

Please sign in to comment.