Skip to content

Commit

Permalink
Always get or create Public group in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Fingel committed Feb 6, 2025
1 parent b8c6318 commit a8be0ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tom_targets/migrations/0025_auto_20250206_2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def remove_public_group(apps, schema_editor):
UserObjectPermission = apps.get_model('guardian', 'UserObjectPermission')
GroupObjectPermission = apps.get_model('guardian', 'GroupObjectPermission')

group = Group.objects.get(name='Public')
group, _ = Group.objects.get_or_create(name='Public')

# Delete Target permissions for public group
GroupObjectPermission.objects.filter(group=group, content_type__model=target_model.lower()).delete()
Expand Down

0 comments on commit a8be0ca

Please sign in to comment.