#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)
follow-up: 2 comment:1 by , 7 years ago
| Component: | Database layer (models, ORM) → Migrations |
|---|---|
| Resolution: | → duplicate |
| Status: | new → closed |
comment:2 by , 7 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.
Duplicate of #24964.