Skip to content

Commit e932698

Browse files
committed
Fix contract bug with old migration
1 parent 1d4bafc commit e932698

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ansible_base/rbac/management/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ def create_dab_permissions(app_config, verbosity=2, interactive=True, using=DEFA
2121
2222
The core logic is mainly in the other method, and this is to adhere to the post_migrate contract
2323
"""
24-
if app_config.label != 'dab_rbac':
25-
return
26-
2724
# NOTE: similar methods, like for contenttypes checks app models_module
2825
# but we know this is for dab_rbac, and we know it has models, so that is irrelevant
29-
3026
if not permission_registry._registry:
3127
logger.warning('DAB RBAC app is installed but no models are registered')
3228
return
@@ -44,6 +40,9 @@ def create_dab_permissions(app_config, verbosity=2, interactive=True, using=DEFA
4440
old_create_dab_permissions(app_config, apps=apps)
4541
return
4642

43+
if app_config.label != 'dab_rbac':
44+
return
45+
4746
if not router.allow_migrate_model(using, dab_ct_cls):
4847
# Uncommon case, code logic is using a replica database or something, unlikely to be relevant
4948
return

0 commit comments

Comments
 (0)