Skip to content

Add enum for environment names#2550

Merged
whabanks merged 7 commits intomainfrom
chore/notify-env-enum
Feb 11, 2026
Merged

Add enum for environment names#2550
whabanks merged 7 commits intomainfrom
chore/notify-env-enum

Conversation

@whabanks
Copy link
Copy Markdown
Contributor

@whabanks whabanks commented Feb 4, 2026

Summary | Résumé

We had an incident where the RTE feature was to only be enabled if the current environment != production. However the comparison string used PROD instead of production.

This PR will:

  • Add a place for enums to live, in app/enums.py
  • Add a new enum called NotifyEnv
  • Registers the enum in jinja_env.globals for quick access in jinja templates

Jinja Usage:

{% if config["NOTIFY_ENVIRONMENT"] != NotifyEnv.PRODUCTION.value %}
...

.py files

from app import NotifyEnv

if current_app.config["NOTIFY_ENVIRONMENT"] != NotifyEnv.PRODUCTION.value:
...

Test instructions | Instructions pour tester la modification

CI is passing

  • If you really wanna test, add checks from above to a jinja template and / or endpoint and set breakpoints.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Member

@andrewleith andrewleith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use these in config.py as well?

@whabanks
Copy link
Copy Markdown
Contributor Author

whabanks commented Feb 10, 2026

Should we use these in config.py as well?

That's a good idea, helps with visibility too. I've added them to config.py and refactored existing checks to use the Enum.

@whabanks whabanks requested a review from andrewleith February 10, 2026 15:20
@whabanks whabanks merged commit 064993e into main Feb 11, 2026
10 checks passed
@whabanks whabanks deleted the chore/notify-env-enum branch February 11, 2026 20:09
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.

3 participants