# Generated by Django 5.2.1 on 2025-07-31 05:12

import json
import accrete.fields
from django.db import migrations
from django.conf import settings


def char_to_translated_char(apps, schema):
    AccessGroup = apps.get_model('accrete', 'AccessGroup')
    default_lang = getattr(settings, 'LANGUAGE_CODE', 'en-us')
    for group in AccessGroup.objects.all():
        group.name = json.dumps({default_lang: group.name})
        group.save()


class Migration(migrations.Migration):

    dependencies = [
        ('accrete', '0008_alter_member_access_groups_and_more'),
    ]

    operations = [
        migrations.RunPython(char_to_translated_char),
        migrations.AlterField(
            model_name='accessgroup',
            name='name',
            field=accrete.fields.TranslatedCharField(verbose_name='Name'),
        ),
    ]
