Fixes #21117: Avoid exception when attempting to create v2 token without API_TOKEN_PEPPERS defined #608

Closed
opened 2026-04-05 16:52:15 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jeremystretch on 1/12/2026

Fixes: #21117

Extend clean() on the Token model to check that API_TOKEN_PEPPERS is defined.

I initially attempted to disable the v2 choice in the form field when peppers are not defined but it would require implementing a custom widget, which didn't seem worth the effort given that we want to encourage users to adopt v2 tokens ASAP.

*Originally created by @jeremystretch on 1/12/2026* ### Fixes: #21117 Extend `clean()` on the Token model to check that `API_TOKEN_PEPPERS` is defined. I initially attempted to disable the v2 choice in the form field when peppers are not defined but it would require implementing a custom widget, which didn't seem worth the effort given that we want to encourage users to adopt v2 tokens ASAP.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#608