#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.06d298cffe3c44fae4fc7838231654e8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.