From 2334c7fbe52a58b242b341a221e826b0f399f1ba Mon Sep 17 00:00:00 2001 From: "Kyle D. McCormick" Date: Thu, 16 Jan 2025 13:44:14 -0500 Subject: [PATCH] refactor: simplify THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS --- lms/envs/production.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lms/envs/production.py b/lms/envs/production.py index 47759e928c7..eddb1fa1364 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -411,12 +411,8 @@ def get_env_setting(setting): # TODO: This logic is somewhat insane. We're not sure if it's intentional or not. We've left it # as-is for strict backwards compatibility, but it's worth revisiting. - if ( - # if we didn't override the value in YAML, - 'THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS' not in _YAML_TOKENS or - # OR we overrode it to a truthy value, - (hours := _YAML_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERDIOD_HOURS', 24)) - ): + if hours := _YAML_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD', 24): + # If we didn't override the value in YAML, OR we overrode it to a truthy value, # then update CELERYBEAT_SCHEDULE. CELERYBEAT_SCHEDULE['refresh-saml-metadata'] = { 'task': 'common.djangoapps.third_party_auth.fetch_saml_metadata',