Flagsmith/flagsmith

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

Open

#6.597 aberto em 27 de jan. de 2026

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)Python (264 forks)batch import
apigood first issue

Métricas do repositório

Stars
 (3.475 stars)
Métricas de merge de PR
 (Mesclagem média 3d 7h) (157 fundiu PRs em 30d)

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.

Guia do colaborador