fix(preferences): validate home_currency against currency choices - #297
Open
fjen wants to merge 1 commit into
Open
fix(preferences): validate home_currency against currency choices#297fjen wants to merge 1 commit into
fjen wants to merge 1 commit into
Conversation
- add Currency.choices() mapping codes to "CODE - Name" labels and use it in currency_field() - constrain GlobalPreferences.home_currency via model choices and the searchable currency_field() dropdown; drop the widget override - narrow column to varchar(3); migration 0012 resets stored values that cannot be a valid ISO code to EUR before narrowing - get_home_currency() falls back to EUR for unparseable stored values
fjen
force-pushed
the
fix/currency-choices
branch
from
August 31, 2026 15:36
34f32f7 to
e5a01d4
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



GlobalPreferences.home_currencywas not validated at all and had max_length of 255. It was possible to set it to arbitrary values. We have a set of fixed currency codes with 3 chars.This adds
Currency.choices()that can be used elsewhere. The global prefs now also use the SelectSearchWidget.Added migration and fallbacks.