# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-31 17:27
from __future__ import unicode_literals

from django.db import migrations


def remove_comma_from_creator_contributor_for_empty_author_name(apps, schema_editor):
    Creator = apps.get_model('hs_core', 'Creator')
    for creator in Creator.objects.all():
        if creator.name == ', ':
            creator.name = ''
            creator.save()
    Contributor = apps.get_model('hs_core', 'Contributor')
    for contributor in Contributor.objects.all():
        if contributor.name == ',' or contributor.name == ', ':
            contributor.name = ''
            contributor.save()


class Migration(migrations.Migration):

    dependencies = [
        ('hs_core', '0054_auto_20201028_1432'),
    ]

    operations = [
        migrations.RunPython(remove_comma_from_creator_contributor_for_empty_author_name),
    ]
