Flagsmith / Flagsmith/flagsmith
Improve ORM enum ergonomics for feature health choices
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 567
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 121
Description
`FeatureHealthEventType` and `FeatureHealthProviderName` subclass base `models.Choices`, so their members aren't `str` and depend on `.value` unwrapping to evaluate correctly in DB queries. Normalise to `TextChoices` (as done for `TagType` in #7877).
## Acceptance criteria
- [ ] Both evaluate correctly in queries without `.value` unwrapping.
- [ ] Stored values unchanged.
- [ ] Tests exercise the members directly.
Contributor guide
Research direction
Locate FeatureHealthEventType and FeatureHealthProviderName, then compare their declarations with TagType from issue #7877. Update the enum declarations so members work directly in ORM queries, preserve stored values, and add or adjust tests that exercise the members without .value unwrapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100