Opened 5 years ago

Closed 5 years ago

#30926 closed Bug (duplicate)

passing an empty string to help_text in model fields using ugettext_lazy causes new migrations without any change

Reported by: Mohamad A. Owned by: nobody
Component: Migrations Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A sample of the error would be something like the following

from django.db import models
from django.utils.translation import ugettext_lazy as _

class sample(models.Model):
    sample_field = models.CharField(max_length=5, help_text=_(""))

Executing makemigrations command generates new migration file without any change in the contents.
The previous model generates the following migration file:

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('mig', '0005_auto_20191029_1638'),
    ]

    operations = [
        migrations.AlterField(
            model_name='sample',
            name='sample_field',
            field=models.CharField(help_text='', max_length=5),
        ),
    ]

Attachments (2)

mig.zip (158 bytes ) - added by Mohamad A. 5 years ago.
Sample project
bug.zip (21.8 KB ) - added by Mohamad A. 5 years ago.

Download all attachments as: .zip

Change History (3)

by Mohamad A., 5 years ago

Attachment: mig.zip added

Sample project

by Mohamad A., 5 years ago

Attachment: bug.zip added

comment:1 by Simon Charette, 5 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #24964.

Note: See TracTickets for help on using tickets.
Back to Top