Skip to content

refactor ratings in prep for fastapi#11985

Merged
RayBB merged 1 commit into
masterfrom
fastapi-prep/ratings
Mar 3, 2026
Merged

refactor ratings in prep for fastapi#11985
RayBB merged 1 commit into
masterfrom
fastapi-prep/ratings

Conversation

@RayBB
Copy link
Copy Markdown
Collaborator

@RayBB RayBB commented Mar 3, 2026

No description provided.

@RayBB
Copy link
Copy Markdown
Collaborator Author

RayBB commented Mar 3, 2026

AI review:

Summary: Refactors the ratings GET endpoint to extract get_ratings_summary as a static method in preparation for FastAPI migration.
Changes

  • Extracted logic into a static method get_ratings_summary(work_id)
  • Returns a dict instead of serialized JSON string
  • The GET method now calls the static method and wraps result in json.dumps()
    Potential Risks
  1. No test updates visible: If existing tests call this endpoint and expect a JSON string response, they may fail. Check if tests need updating.
  2. Internal usage: If any other code calls this method directly (unlikely given it's a page handler), it would now get a dict instead of a string.

@RayBB
Copy link
Copy Markdown
Collaborator Author

RayBB commented Mar 3, 2026

This is the last of these needed for api.py

@RayBB RayBB merged commit e6633c4 into master Mar 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant