Skip to content

Convert EMAIL_CC_CONTACTS entries to tuples - #51

Open
funzoneq wants to merge 1 commit into
peering-manager:mainfrom
funzoneq:email-cc-contacts-tuples
Open

funzoneq wants to merge 1 commit into
peering-manager:mainfrom
funzoneq:email-cc-contacts-tuples

Conversation

@funzoneq

@funzoneq funzoneq commented Nov 18, 2026 •

Copy link
Copy Markdown

EMAIL_CC_CONTACTS is parsed with json.loads, which cannot produce tuples. Peering Manager only treats tuple entries as (address, name) pairs (AutonomousSystem.get_cc_email_contacts), so configuring

EMAIL_CC_CONTACTS='[["peering@example.com", "Peering Team"]]'

passes the whole list through as if it were the address, and the CC choices in the AS e-mail form are broken.

This adds an _AS_CONTACTS mapper that converts inner lists to tuples while leaving plain address strings untouched, so (address, name) contacts can be configured from the environment.

Plain address strings still break the PeeringDB network e-mail form, which uses EMAIL_CC_CONTACTS directly as Django choices; that is fixed in peering-manager itself by peering-manager/peering-manager#998.

🤖 Generated with Claude Code

EMAIL_CC_CONTACTS is parsed with json.loads, which cannot produce tuples.
Peering Manager only treats tuple entries as (address, name) pairs, so a
JSON list such as [["peering@example.com", "Peering Team"]] ended up being
used as the address itself in the AS e-mail form. Convert inner lists to
tuples so (address, name) contacts can be configured from the environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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