[Django] #30926: passing an empty string to help_text in model fields using ugettext_lazy causes new migrations without any change

3 views
Skip to first unread message

Django

unread,
Oct 29, 2019, 12:39:59 PM10/29/19
to django-...@googlegroups.com
#30926: passing an empty string to help_text in model fields using ugettext_lazy
causes new migrations without any change
---------------------------------------+------------------------
Reporter: mabuelhagag | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
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),
),
]

}}}

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

Django

unread,
Oct 29, 2019, 12:42:09 PM10/29/19
to django-...@googlegroups.com
#30926: passing an empty string to help_text in model fields using ugettext_lazy
causes new migrations without any change
-----------------------------+--------------------------------------

Reporter: mabuelhagag | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.2
Severity: Normal | Resolution:

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 mabuelhagag):

* Attachment "mig.zip" added.

Sample project

Django

unread,
Oct 29, 2019, 12:46:45 PM10/29/19
to django-...@googlegroups.com
#30926: passing an empty string to help_text in model fields using ugettext_lazy
causes new migrations without any change
-----------------------------+--------------------------------------

Reporter: mabuelhagag | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.2
Severity: Normal | Resolution:

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 mabuelhagag):

* Attachment "bug.zip" added.

Django

unread,
Oct 29, 2019, 3:34:33 PM10/29/19
to django-...@googlegroups.com
#30926: passing an empty string to help_text in model fields using ugettext_lazy
causes new migrations without any change
-----------------------------+--------------------------------------
Reporter: mabuelhagag | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 2.2
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 Simon Charette):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #24964.

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

Reply all
Reply to author
Forward
0 new messages