Description
In the admin panel's suggestion processing endpoint (/admin/suggestions/<suggestion_id>), there is an HTTP status code inconsistency.
When a suggestion has already been processed (status != 'pending'), the endpoint returns a 400 (Bad Request) status code. However, the @spec.validate decorator declares HTTP_409=ErrorResponse, and semantically, a 409 (Conflict) status would be more appropriate for this situation.
Context
- File:
goodmap/core_api.py
- Endpoint:
PUT /admin/suggestions/<suggestion_id>
- Current behavior: Returns 400 for already-processed suggestions
- Expected behavior: Should return 409 to match the spec and semantic meaning
References
Reported by: @raven-wing
Description
In the admin panel's suggestion processing endpoint (
/admin/suggestions/<suggestion_id>), there is an HTTP status code inconsistency.When a suggestion has already been processed (status != 'pending'), the endpoint returns a 400 (Bad Request) status code. However, the
@spec.validatedecorator declaresHTTP_409=ErrorResponse, and semantically, a 409 (Conflict) status would be more appropriate for this situation.Context
goodmap/core_api.pyPUT /admin/suggestions/<suggestion_id>References
Reported by: @raven-wing