# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-07-24 11:42
from __future__ import unicode_literals

from django.db import migrations

def prepend_http(apps, schema_editor):
    StudyGroup = apps.get_model("studygroups", "StudyGroup")
    study_groups = StudyGroup.objects.all().exclude(venue_website='')
    study_groups = study_groups.exclude(venue_website__startswith='http')

    for study_group in study_groups:
        study_group.venue_website = 'http://{}'.format(study_group.venue_website)
        study_group.save()



class Migration(migrations.Migration):

    dependencies = [
        ('studygroups', '0093_application_mobile_opt_out_at'),
    ]

    operations = [
        migrations.RunPython(prepend_http),
    ]

Add migration to fix URLs for studygroup venue websites
Add migration to fix URLs for studygroup venue websites
