Opened 6 years ago

Closed 6 years ago

Last modified 6 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

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 by Tim Graham, 6 years ago

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

Duplicate of #24964.

in reply to:  1 comment:2 by Javier Matos Odut, 6 years ago

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