Skip to content

ref: Add convert_args to BroadcastDetailsEndpoint#106159

Merged
oioki merged 1 commit intomasterfrom
ref/broadcast-details-convert-args
Jan 16, 2026
Merged

ref: Add convert_args to BroadcastDetailsEndpoint#106159
oioki merged 1 commit intomasterfrom
ref/broadcast-details-convert-args

Conversation

@oioki
Copy link
Member

@oioki oioki commented Jan 13, 2026

Summary

Implement convert_args method in BroadcastDetailsEndpoint to eliminate duplicate broadcast fetching across get() and put() methods.

Changes:

  • Added convert_args method to resolve broadcast object once during URL resolution
  • Removed duplicate _get_broadcast() calls from get() and put() methods
  • Added type annotation int | str for broadcast_id parameter
  • Added return type annotation Broadcast for _get_broadcast() helper
  • Preserved permission-based queryset logic (admin vs regular users)

Benefits:

  • Reduces redundant database queries
  • Improves code maintainability
  • Follows established pattern used in other endpoints

Test Plan

  • All existing tests pass (4/4)
  • No behavioral changes
  • Error codes preserved (404 for invalid broadcasts)
  • Pre-commit hooks pass

@oioki oioki requested a review from a team as a code owner January 13, 2026 07:41
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 13, 2026
Implement convert_args method to eliminate duplicate broadcast fetching
across get() and put() methods. This ensures the broadcast object is
retrieved once during URL resolution and passed to the endpoint methods,
reducing redundant database queries and improving code maintainability.
@oioki oioki force-pushed the ref/broadcast-details-convert-args branch from 8ed62f4 to c2fbb96 Compare January 13, 2026 10:41
@oioki oioki requested a review from a team January 13, 2026 11:09
@oioki oioki merged commit dc8edd8 into master Jan 16, 2026
66 checks passed
@oioki oioki deleted the ref/broadcast-details-convert-args branch January 16, 2026 09:29
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants