Skip to content

Fix incorrect getattr keys in settings.py#326

Open
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
billkhiz-bit:fix/settings-getattr-typos-323
Open

Fix incorrect getattr keys in settings.py#326
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
billkhiz-bit:fix/settings-getattr-typos-323

Conversation

@billkhiz-bit
Copy link
Copy Markdown

Summary

Fixes two copy-paste errors in django_ledger/settings.py where getattr calls referenced the wrong settings key:

  • Line 31: DJANGO_LEDGER_ACCOUNT_CODE_USE_PREFIX was reading DJANGO_LEDGER_ACCOUNT_CODE_GENERATE_LENGTH instead of its own key — this caused the prefix setting to be silently ignored, always returning the value of GENERATE_LENGTH (an integer) instead of the expected boolean.
  • Line 37: DJANGO_LEDGER_RECEIPT_NUMBER_PREFIX was reading DJANGO_LEDGER_BILL_NUMBER_PREFIX instead 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 getattr key 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 getattr lines without updating the key string).

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
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.

Bug: Incorrect settings attribute used for DJANGO_LEDGER_ACCOUNT_CODE_USE_PREFIX

1 participant