fix: return 404 instead of 500 for invalid identity_pk in feature states - #8558
PrakashWebDevX wants to merge 1 commit into
Conversation
…tes IdentityFeatureStateViewSet.get_queryset() passed the raw identity_pk URL kwarg directly into a queryset filter, causing Django's ORM to raise an unhandled ValueError when the value wasn't a valid integer (e.g. a malformed or non-numeric ID). Use get_object_or_404 to resolve the identity first, matching the existing pattern already used in this same class's `all()` action. Fixes Flagsmith#7361
|
@PrakashWebDevX is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Severity of issue fixed: Medium ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix: return 404 instead of 500 for invalid identity_pk in feature states
IdentityFeatureStateViewSet.get_queryset() passed the raw identity_pk
URL kwarg directly into a queryset filter, causing Django's ORM to
raise an unhandled ValueError when the value wasn't a valid integer
(e.g. a malformed or non-numeric ID).
Use get_object_or_404 to resolve the identity first, matching the
existing pattern already used in this same class's
all()action.Fixes #7361