emencia / django-blog-lotus

A weblog application with Django.
https://django-blog-lotus.readthedocs.io/
MIT License
5 stars 1 forks source link

v0.5.2 is missing hack against migration for choices update #53

Closed sveetch closed 1 year ago

sveetch commented 1 year ago

Describe the bug When you change your language settings to differ from the one used during lotus development, it will trigger a new pending migration since Django saw changes on language choices that comes from settings.

Environment Not available, this produce on every environment.

To Reproduce Steps to reproduce the behavior:

  1. Install a project with lotus
  2. Change settings.LANGUAGES to something different from the ones used in Lotus development https://github.com/emencia/django-blog-lotus/blob/master/sandbox/settings/base.py#L50
  3. Use makemigrations to check for new migrations
  4. There should be a new pending one for Lotus

Expected behavior This should not happen since we use the callable hack on choices, but migration that alter related field should use the callable also, so Django can not see changes between choice settings and choice in migrations. But these callable hack have been forgotten during the last migration reboot.

Additional context Since there is an ongoing v0.6.0 but v0.5.2 is already used in some production projet, we need to fix this in a v0.5.2.1 and then port it on v0.6.0 (if not already fixed).

sveetch commented 1 year ago

Ongoing v0.5.3 also miss the hack.

sveetch commented 1 year ago

v0.5.2.1 will be the next release fix, next version will contain the fix also.