forked from DGNum/gestioCOF
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
|
# -*- coding: utf-8 -*-
|
||
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.db import migrations, models
|
||
|
|
||
|
import utils.models
|
||
|
|
||
|
|
||
|
def convert_empty_clipper(apps, schema_editor):
|
||
|
CofProfile = apps.get_model("gestioncof", "CofProfile")
|
||
|
CofProfile.objects.filter(login_clipper="").update(login_clipper=None)
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [("gestioncof", "0014_cofprofile_mailing_unernestaparis")]
|
||
|
|
||
|
operations = [
|
||
|
migrations.AlterField(
|
||
|
model_name="cofprofile",
|
||
|
name="login_clipper",
|
||
|
field=models.CharField(
|
||
|
verbose_name="Login clipper",
|
||
|
max_length=32,
|
||
|
null=True,
|
||
|
blank=True,
|
||
|
default="",
|
||
|
),
|
||
|
),
|
||
|
migrations.RunPython(convert_empty_clipper),
|
||
|
migrations.AlterField(
|
||
|
model_name="cofprofile",
|
||
|
name="login_clipper",
|
||
|
field=utils.models.NullCharField(
|
||
|
verbose_name="Login clipper", max_length=32, default="", unique=True
|
||
|
),
|
||
|
),
|
||
|
]
|