Skip to content

Commit

Permalink
refactor: simplify THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Jan 16, 2025
1 parent 2c1f09b commit 2334c7f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2334c7f

Please sign in to comment.