[Django] #29958: Combining empty help_text in model field + gettext_lazy will make new migrations every time we run makemigrations

30 views
Skip to first unread message

Django

unread,
Nov 15, 2018, 7:38:00 PM11/15/18
to django-...@googlegroups.com
#29958: Combining empty help_text in model field + gettext_lazy will make new
migrations every time we run makemigrations
-------------------------------------+-------------------------------------
Reporter: Javier | Owner: nobody
Matos Odut |
Type: Bug | Status: new
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/29958>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 15, 2018, 7:50:04 PM11/15/18
to django-...@googlegroups.com
#29958: Combining empty help_text in model field + gettext_lazy will make new
migrations every time we run makemigrations
-----------------------------------+--------------------------------------
Reporter: Javier Matos Odut | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* component: Database layer (models, ORM) => Migrations
* resolution: => duplicate


Comment:

Duplicate of #24964.

--
Ticket URL: <https://code.djangoproject.com/ticket/29958#comment:1>

Django

unread,
Nov 15, 2018, 8:16:10 PM11/15/18
to django-...@googlegroups.com
#29958: Combining empty help_text in model field + gettext_lazy will make new
migrations every time we run makemigrations
-----------------------------------+--------------------------------------
Reporter: Javier Matos Odut | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Javier Matos Odut):

Replying to [comment:1 Tim Graham]:
> Duplicate of #24964.

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

--
Ticket URL: <https://code.djangoproject.com/ticket/29958#comment:2>

Reply all
Reply to author
Forward
0 new messages