Merge pull request #793 from gpodder/remove-advertise
[mygpo.git] / mygpo / podcasts / migrations / 0016_restrictions_notnull.py
blob4384a03df115f367af0228709162d6e713d5ab90
1 # encoding: utf8
4 from django.db import models, migrations
7 def set_restriction(apps, schema_editor):
8 Podcast = apps.get_model("podcasts", "Podcast")
9 for podcast in Podcast.objects.filter(restrictions__isnull=True):
10 podcast.restrictions = ""
11 podcast.save()
14 class Migration(migrations.Migration):
16 dependencies = [("podcasts", "0015_auto_20140616_2126")]
18 operations = [
19 migrations.RunPython(set_restriction),
20 migrations.AlterField(
21 model_name="podcast",
22 name="restrictions",
23 field=models.CharField(default="", max_length=20, blank=True),