mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Disable our wrapping of the Django settings during migrations
This will hopefully get us past the unfortunate check against the HostMetric table, which doesn't exist when you are upgrading from 3.8 to 4.x. Additionally, guard against AUTH_LDAP_GROUP_TYPE not being in settings for conf migration 0006.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import sys
|
||||
|
||||
# Django
|
||||
from django.apps import AppConfig
|
||||
|
||||
@@ -12,6 +14,9 @@ class ConfConfig(AppConfig):
|
||||
|
||||
def ready(self):
|
||||
self.module.autodiscover()
|
||||
from .settings import SettingsWrapper
|
||||
|
||||
SettingsWrapper.initialize()
|
||||
if not set(sys.argv) & {'migrate', 'check_migrations'}:
|
||||
|
||||
from .settings import SettingsWrapper
|
||||
|
||||
SettingsWrapper.initialize()
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.utils.timezone import now
|
||||
|
||||
|
||||
def fill_ldap_group_type_params(apps, schema_editor):
|
||||
group_type = settings.AUTH_LDAP_GROUP_TYPE
|
||||
group_type = getattr(settings, 'AUTH_LDAP_GROUP_TYPE', None)
|
||||
Setting = apps.get_model('conf', 'Setting')
|
||||
|
||||
group_type_params = {'name_attr': 'cn', 'member_attr': 'member'}
|
||||
|
||||
Reference in New Issue
Block a user