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.

貢獻者指南