

def ensure_http_prefix_contact(apps, schema_editor):
    Contact = apps.get_model('membership', 'Contact')
    for contact in Contact.objects.exclude(homepage='').exclude(homepage__startswith='http://').exclude(homepage__startswith='https://'):
        if contact.homepage:
            if (':/' not in contact.homepage):
                contact.homepage = 'http://{uri}'.format(uri=contact.homepage)
                Contact.save()

dataset/ETHPy150Open kapsiry/sikteeri/membership/migrations/0003_ensure_http_prefix_contact_uris.py Migration.ensure_http_prefix_contact/VarMisuse@87/121 `contact`->`Contact`