clear settings cache after changing DISABLE_LOCAL_AUTH

This commit is contained in:
Hao Liu 2023-03-06 14:26:31 -05:00
parent da004da68a
commit 7cef4e6db7

View File

@ -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'))