Fix incorrect getattr keys in settings.py#326
Open
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
Open
Fix incorrect getattr keys in settings.py#326billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
Conversation
DJANGO_LEDGER_ACCOUNT_CODE_USE_PREFIX was reading DJANGO_LEDGER_ACCOUNT_CODE_GENERATE_LENGTH instead of its own key, causing the setting to be silently ignored. Also fixes DJANGO_LEDGER_RECEIPT_NUMBER_PREFIX which was reading DJANGO_LEDGER_BILL_NUMBER_PREFIX instead of its own key — a similar copy-paste error on the same page. Fixes arrobalytics#323
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.
Summary
Fixes two copy-paste errors in
django_ledger/settings.pywheregetattrcalls referenced the wrong settings key:DJANGO_LEDGER_ACCOUNT_CODE_USE_PREFIXwas readingDJANGO_LEDGER_ACCOUNT_CODE_GENERATE_LENGTHinstead of its own key — this caused the prefix setting to be silently ignored, always returning the value ofGENERATE_LENGTH(an integer) instead of the expected boolean.DJANGO_LEDGER_RECEIPT_NUMBER_PREFIXwas readingDJANGO_LEDGER_BILL_NUMBER_PREFIXinstead of its own key — this meant receipts would always use the bill prefix, ignoring any custom receipt prefix in Django settings.Changes
Both fixes are single-character corrections to the
getattrkey strings. No new dependencies, no behavioural changes beyond correctly reading the intended settings.Related Issue
Fixes #323
Additional Context
The second bug (line 37, receipt prefix) was found while investigating #323 — same root cause (copy-paste duplication of
getattrlines without updating the key string).