Flagsmith/flagsmith

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

已关闭

#6,597 创建于 2026年1月27日

 (0 条评论) (0 个反应) (0 位负责人)Python (264 个派生)batch import
apigood first issue

仓库指标

星标
 (3,475 个星标)
PR 合并指标
 (平均合并 3天 7小时) (30 天内合并 157 个 PR)

描述

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.

贡献者指南