Skip to content

Commit

Permalink
Get rid of prints.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Sep 25, 2024
1 parent 68557ef commit e6e7b6c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions galaxy_ng/app/migrations/_dab_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ def split_pulp_roles(apps, schema_editor):
GroupRole = apps.get_model('core', 'GroupRole')

for corerole in Role.objects.all():
print(f'ROLE {corerole} {corerole.name}')
split_roles = {}
for assignment_cls in (UserRole, GroupRole):
print(f'\t{assignment_cls}')
for pulp_assignment in assignment_cls.objects.filter(role=corerole, content_type__isnull=False):
print(f'\t\t{assignment_cls} {pulp_assignment}')
if pulp_assignment.content_type_id not in split_roles:
print(f'\t\t\t{pulp_assignment.content_type_id}')
new_data = {
'description': corerole.description,
'name': f'{corerole.name}_{pulp_assignment.content_type.model}'
Expand All @@ -67,7 +63,6 @@ def split_pulp_roles(apps, schema_editor):

split_roles[pulp_assignment.content_type_id] = new_role

print(f"\t\tchange .role from {pulp_assignment.role.name} to {split_roles[pulp_assignment.content_type_id].name}")
pulp_assignment.role = split_roles[pulp_assignment.content_type_id]
pulp_assignment.save(update_fields=['role'])

Expand Down Expand Up @@ -105,8 +100,6 @@ def copy_roles_to_role_definitions(apps, schema_editor):

def migrate_role_assignments(apps, schema_editor):

print('MIGRATE ROLE ASSIGNMENTS ...')

UserRole = apps.get_model('core', 'UserRole')
GroupRole = apps.get_model('core', 'GroupRole')
Group = apps.get_model('auth', 'Group')
Expand Down

0 comments on commit e6e7b6c

Please sign in to comment.