Skip to content

Commit

Permalink
Merge 8475408 into 5122766
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Paz committed Oct 4, 2018
2 parents 5122766 + 8475408 commit c3e7789
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bothub/common/migrations/0021_auto_20180921_1259.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import re


def populate_empty_intent(apps, *args):
RepositoryExample = apps.get_model('common', 'RepositoryExample')
RepositoryExample.objects.filter(intent='').update(intent='no_intent')


class Migration(migrations.Migration):

dependencies = [
Expand All @@ -17,4 +22,5 @@ class Migration(migrations.Migration):
name='intent',
field=models.CharField(default='no_intent', help_text='Example intent reference', max_length=64, validators=[django.core.validators.RegexValidator(re.compile('^[-a-z0-9_]+\\Z'), 'Enter a valid value consisting of lowercase letters, numbers, underscores or hyphens.', 'invalid')], verbose_name='intent'),
),
migrations.RunPython(populate_empty_intent),
]

0 comments on commit c3e7789

Please sign in to comment.