Skip to content

Fix duplicate ECOMMERCE_DEFAULT_PAYMENT_GATEWAY setting registration - #3839

Closed
annagav wants to merge 1 commit into
mainfrom
ag/fix-duplicate-ecommerce-payment-gateway-setting
Closed

Fix duplicate ECOMMERCE_DEFAULT_PAYMENT_GATEWAY setting registration#3839
annagav wants to merge 1 commit into
mainfrom
ag/fix-duplicate-ecommerce-payment-gateway-setting

Conversation

@annagav

@annagav annagav commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

N/A

Description (What does it do?)

The mitol-django-payment-gateway version currently pinned in pyproject.toml (2026.8.5) restructured its settings module: it now declares ECOMMERCE_DEFAULT_PAYMENT_GATEWAY itself (defaulting
to "None"), and import_settings_modules() injects that directly into main.settings's namespace.

  • main/settings.py still had its own get_string(name="ECOMMERCE_DEFAULT_PAYMENT_GATEWAY", ...) call declaring the same env var name, which mitol.common.envs rejects as a duplicate registration —
    crashing Django at import time with ValueError: Environment variable 'ECOMMERCE_DEFAULT_PAYMENT_GATEWAY' was used more than once.
  • This currently blocks Django from booting at all (manage.py check, migrate, and the full test suite all fail immediately on settings import).

How can this be tested?

Additional Context

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>
@github-actions

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@annagav annagav closed this Aug 10, 2026
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.

1 participant