Flagsmith/flagsmith

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

Fermée

#6 597 ouverte le 27 janv. 2026

 (0 commentaire) (0 réaction) (0 personne assignée)Python (264 forks)batch import
apigood first issue

Métriques du dépôt

Stars
 (3 475 étoiles)
Métriques de merge PR
 (Merge moyen 3j 7h) (157 PRs mergées en 30 j)

Description

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.

Guide contributeur