Skip to content

Admin panel: HTTP status code inconsistency in suggestion processing endpoint #311

@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions