Flagsmith/flagsmith

500 when calling /api/v1/features/featurestates/{pk}/ with empty environment

Chiusa

#6597 aperta il 27 gen 2026

 (0 commenti) (0 reazioni) (0 assegnatari)Python (264 fork)batch import
apigood first issue

Metriche repository

Star
 (3475 stelle)
Metriche merge PR
 (Merge medio 3g 7h) (157 PR mergiate in 30 g)

Descrizione

Sentry Issue: FLAGSMITH-API-5GQ

AttributeError: 'NoneType' object has no attribute 'id'
(8 additional frame(s) were not displayed)
...
  File "features/serializers.py", line 578, in validate_environment
    if self.instance and self.instance.environment_id != environment.id:  # type: ignore[union-attr]

Acceptance criteria

  • /api/v1/features/featurestates/{pk}/ responds with HTTP 400 if environment is null in the payload.

Guida contributor