diff --git a/peachjam/migrations/0163_allusers_group.py b/peachjam/migrations/0163_allusers_group.py new file mode 100644 index 000000000..0eaa175e9 --- /dev/null +++ b/peachjam/migrations/0163_allusers_group.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.15 on 2024-10-03 05:27 + +from django.db import migrations + + +def set_allusers(apps, schema_editor): + User = apps.get_model("auth", "User") + Group = apps.get_model("auth", "Group") + allusers_group, _ = Group.objects.get_or_create(name="AllUsers") + + for user in User.objects.all(): + user.groups.add(allusers_group) + + +class Migration(migrations.Migration): + + dependencies = [ + ("peachjam", "0162_make_image_filenames_unique"), + ] + + operations = [ + migrations.RunPython(set_allusers, migrations.RunPython.noop), + ]