#24964: Infinite migrations with empty help_text via ugettext_lazy
-------------------------------------+-------------------------------------
     Reporter:  gimbo                |                    Owner:  coldmind
         Type:  Bug                  |                   Status:  assigned
    Component:  Migrations           |                  Version:  1.8
     Severity:  Release blocker      |               Resolution:
     Keywords:  migrations,          |             Triage Stage:  Accepted
  internationalisation               |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by coldmind):

 * owner:  nobody => coldmind
 * status:  new => assigned


Comment:

 When autodetector is doing deconstruction, there is
 
https://github.com/django/django/blob/3c593ba79e5bdee46419e2aa6b14e7ce8bc01758/django/db/models/fields/__init__.py#L408

 For example, in our case initial migration was with `help_text=_('')`
 resolved to `''`, simple empty string.
 Later, there is
 
https://github.com/django/django/blob/3c593ba79e5bdee46419e2aa6b14e7ce8bc01758/django/db/models/fields/__init__.py#L432.
 So, this value is ignored, and not added to deconstruction, so
 makemigration will produce it as a change.

 If I will add migration with `help_text=''` (without lazy), it will appear
 in migration as `b''`, so the check above will work and it will appear in
 deconstruction.

 So, do we need to change behavior of resolving lazy empty string, or
 change behavior in deconstruction?

--
Ticket URL: <https://code.djangoproject.com/ticket/24964#comment:6>
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/063.9d23fdc972e182b32c5df033cba94398%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to