Fix duplicate ECOMMERCE_DEFAULT_PAYMENT_GATEWAY setting registration - #3839
Closed
annagav wants to merge 1 commit into
Closed
Fix duplicate ECOMMERCE_DEFAULT_PAYMENT_GATEWAY setting registration#3839annagav wants to merge 1 commit into
annagav wants to merge 1 commit into
Conversation
mitol-django-payment-gateway 2026.8.5 restructured its settings module to declare ECOMMERCE_DEFAULT_PAYMENT_GATEWAY itself (defaulting to "None"), which import_settings_modules() injects into main.settings. The app's own redundant get_string() call for the same name then crashes Django on boot with "Environment variable 'ECOMMERCE_DEFAULT_PAYMENT_GATEWAY' was used more than once", since mitol.common.envs rejects duplicate registrations. Remove the redundant get_string() call and keep the existing "None" -> CyberSource coercion, which operates on the plain variable rather than re-registering it, preserving the previous default behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
OpenAPI ChangesShow/hide changesUnexpected changes? Ensure your branch is up-to-date with |
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.
What are the relevant tickets?
N/A
Description (What does it do?)
The
mitol-django-payment-gatewayversion currently pinned inpyproject.toml(2026.8.5) restructured its settings module: it now declaresECOMMERCE_DEFAULT_PAYMENT_GATEWAYitself (defaultingto
"None"), andimport_settings_modules()injects that directly intomain.settings's namespace.main/settings.pystill had its ownget_string(name="ECOMMERCE_DEFAULT_PAYMENT_GATEWAY", ...)call declaring the same env var name, whichmitol.common.envsrejects as a duplicate registration —crashing Django at import time with
ValueError: Environment variable 'ECOMMERCE_DEFAULT_PAYMENT_GATEWAY' was used more than once.manage.py check,migrate, and the full test suite all fail immediately on settings import).How can this be tested?
Additional Context