Skip to content

Commit ef329b4

Browse files
committed
Fix double assignment
1 parent 2e9d848 commit ef329b4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ansible_base/rbac/management/create_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ def create_DAB_contenttypes(
6666
current_max_id = dab_ct_cls.objects.order_by('-id').values_list('id', flat=True).first() or 0
6767
ct_item_data['id'] = current_max_id + 1
6868
ct_data.append(ct_item_data)
69-
if not ct_data:
70-
return []
7169

7270
# Create the items here
7371
cts = []
@@ -78,6 +76,7 @@ def create_DAB_contenttypes(
7876
for ct in cts:
7977
logger.debug("Adding DAB content type " f"'{ct.service}:{ct.app_label} | {ct.model}'")
8078

79+
# Update, or set for the first time, the parent type reference
8180
updated_ct = 0
8281
for ct in dab_ct_cls.objects.all():
8382
ct_model_class = model_class(apps, ct)

ansible_base/rbac/migrations/0005_remote_permissions_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def create_types_if_needed(apps, schema_editor):
1010
Only needed in the upgrade case, otherwise better to run at true post-migrate.
1111
"""
1212
permission_cls = apps.get_model('dab_rbac', 'DABPermission')
13-
rd_cls = permission_cls = apps.get_model('dab_rbac', 'RoleDefinition')
13+
rd_cls = apps.get_model('dab_rbac', 'RoleDefinition')
1414
if permission_cls.objects.exists() or rd_cls.objects.exists():
1515
from ansible_base.rbac.management.create_types import create_DAB_contenttypes
1616

0 commit comments

Comments
 (0)