Skip to content

🐛 Fix spurious language field migrations across projects - #101

Merged
noeddl merged 2 commits into
mainfrom
noeddl/fix-language-field
Apr 20, 2026
Merged

noeddl merged 2 commits into
mainfrom
noeddl/fix-language-field

Conversation

@noeddl

@noeddl noeddl commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Replace inline use of settings.LANGUAGE_CODE and settings.LANGUAGES for default and choices with callables so changes to these settings no longer trigger new migrations.

The Django docs list this exact scenario as a reason to pass a callable to choices:

Passing a callable for choices can be particularly handy when, for example, the choices are:
[…]
- a list that is mostly stable but could vary from time to time or from project to project. Examples in this category are using third-party apps that provide a well-known inventory of values, such as currencies, countries, languages, time zones, etc.

noeddl added 2 commits April 15, 2026 11:17
Replace inline use of settings.LANGUAGE_CODE and settings.LANGUAGES with callables so changes to these settings no longer trigger new migrations.

@n0ctua n0ctua left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, well done 👍

@noeddl
noeddl merged commit 8ffb530 into main Apr 20, 2026
3 checks passed
@noeddl
noeddl deleted the noeddl/fix-language-field branch April 20, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants