From 7cef4e6db7bac6b7442c791dbfa5fb5610a5b64c Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Mon, 6 Mar 2023 14:26:31 -0500 Subject: [PATCH] clear settings cache after changing DISABLE_LOCAL_AUTH --- awx/main/management/commands/enable_local_authentication.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/management/commands/enable_local_authentication.py b/awx/main/management/commands/enable_local_authentication.py index a9db33709c..1811ccd898 100644 --- a/awx/main/management/commands/enable_local_authentication.py +++ b/awx/main/management/commands/enable_local_authentication.py @@ -1,5 +1,6 @@ -from django.core.management.base import BaseCommand, CommandError +from awx.main.tasks.system import clear_setting_cache from django.conf import settings +from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): @@ -31,5 +32,7 @@ class Command(BaseCommand): else: raise CommandError('Please pass --enable flag to allow local auth or --disable flag to disable local auth') + clear_setting_cache.delay(['DISABLE_LOCAL_AUTH']) + def handle(self, **options): self._enable_disable_auth(options.get('enable'), options.get('disable'))