Opened 8 months ago

Closed 8 months ago

Last modified 8 months 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: master
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

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 manage.py 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 8 months ago by Tim Graham

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

Duplicate of #24964.

comment:2 in reply to:  1 Changed 8 months 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