Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#29958 closed Bug (duplicate)

Combining empty help_text in model field + gettext_lazy will make new migrations every time we run makemigrations

Reported by: Javier Matos Odut Owned by: nobody
Component: Migrations Version: dev
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


I have seen that in my project, setting help_text for model field as gettext_lazy with empty string will create new migrations as many times as you run makemigrations command, even when there are no changes.

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

# Create your models here.

class MyModel(models.Model):
    id = models.AutoField(primary_key=True)
    my_field = models.CharField(max_length=2, help_text=_(''))

Then do python makemigrations and it will create migration files forever.

I know using empty string for gettext_lazy is a nonsense, but it should not behave that way.

Change History (2)

comment:1 Changed 4 years ago by Tim Graham

Component: Database layer (models, ORM)Migrations
Resolution: duplicate
Status: newclosed

Duplicate of #24964.

comment:2 in reply to:  1 Changed 4 years ago by Javier Matos Odut

Replying to Tim Graham:

Duplicate of #24964.

Ups, so sorry I did not check it properly before reporting this bug :(

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