# Generated by Django 2.1.7 on 2019-08-09 09:36

from django.db import migrations, models


def migrate_public_event(apps, schema_editor):
    """Migrate options previously with no contents (displayed as "Other:")
    to a new contents ("other").
    The field containing these options is in CommonRequest abstract model,
    implemented in WorkshopRequest, WorkshopInquiryRequest, and
    SelfOrganizedSubmission models."""
    WorkshopRequest = apps.get_model('workshops', 'WorkshopRequest')
    WorkshopInquiryRequest = apps.get_model('extrequests',
                                            'WorkshopInquiryRequest')
    SelfOrganizedSubmission = apps.get_model('extrequests',
                                             'SelfOrganizedSubmission')
    
    WorkshopRequest.objects.filter(public_event="") \
                           .update(public_event="other")
    WorkshopInquiryRequest.objects.filter(public_event="") \
                                  .update(public_event="other")
    SelfOrganizedSubmission.objects.filter(public_event="") \
                                   .update(public_event="other")


class Migration(migrations.Migration):

    dependencies = [
        ('workshops', '0190_auto_20190728_1118'),
        ('extrequests', '0008_auto_20190809_1004'),
    ]

    operations = [
        migrations.AlterField(
            model_name='workshoprequest',
            name='host_responsibilities',
            field=models.BooleanField(default=False, verbose_name='I understand <a href="https://docs.carpentries.org/topic_folders/hosts_instructors/hosts_instructors_checklist.html#host-checklist">the responsibilities of the workshop host</a>, including recruiting local helpers to support the workshop (1 helper for every 8-10 learners).'),
        ),
        migrations.AlterField(
            model_name='workshoprequest',
            name='requested_workshop_types',
            field=models.ManyToManyField(help_text='If your learners are new to programming and primarily interested in working with data, Data Carpentry is likely the best choice. If your learners are interested in learning more about programming, including version control and automation, Software Carpentry is likely the best match. If your learners are people working in library and information related roles interested in learning data and software skills, Library Carpentry is the best choice. Please visit the <a href="https://software-carpentry.org/lessons/">Software Carpentry lessons page</a>, <a href="http://www.datacarpentry.org/lessons/">Data Carpentry lessons page</a>, or the <a href="https://librarycarpentry.org/lessons/">Library Carpentry lessons page</a> for more information about any of our lessons.', limit_choices_to={'active': True}, to='workshops.Curriculum', verbose_name='Which Carpentries workshop are you requesting?'),
        ),
        migrations.AlterField(
            model_name='workshoprequest',
            name='scholarship_circumstances',
            field=models.TextField(blank=True, help_text='Required only if you request a scholarship.', verbose_name='Please explain the circumstances for your scholarship request and let us know what budget you have towards The Carpentries workshop fees.'),
        ),
        migrations.AlterField(
            model_name='workshoprequest',
            name='public_event',
            field=models.CharField(blank=True, choices=[('invite', 'This event is open to learners by invitation only.'), ('closed', 'This event is open to learners inside of my institution.'), ('public', 'This event is open to learners outside of my institution.'), ('other', 'Other:')], default='', help_text='Many of our workshops restrict registration to learners from the hosting institution. If your workshop will be open to registrants outside of your institution please let us know below.', max_length=20, verbose_name='Is this workshop open to the public?'),
        ),
        migrations.RunPython(migrate_public_event),
    ]

[(54, 'django.db.migrations.RunPython', 'migrations.RunPython', False, 'from django.db import migrations, models\n'), (37, 'django.db.models.BooleanField', 'models.BooleanField', False, 'from django.db import migrations, models\n'), (42, 'django.db.models.ManyToManyField', 'models.ManyToManyField', False, 'from django.db import migrations, models\n'), (47, 'django.db.models.TextField', 'models.TextField', False, 'from django.db import migrations, models\n'), (52, 'django.db.models.CharField', 'models.CharField', False, 'from django.db import migrations, models\n')]