Skip to content

Add pagination to GET /api/competitions and fix participating_in leak - #2493

Open
ihsaan-ullah wants to merge 1 commit into
developfrom
competiitons_api
Open

Add pagination to GET /api/competitions and fix participating_in leak#2493
ihsaan-ullah wants to merge 1 commit into
developfrom
competiitons_api

Conversation

@ihsaan-ullah

Copy link
Copy Markdown
Collaborator

Description

  • Paginate the competition list endpoint (LargePagination), and update the Organizing/Participating tabs in competition_list.tag to consume the new {count, next, previous, results} shape with next/previous buttons (hidden on a single page).

  • Fix the navbar competition search to read response.results instead of assuming a bare array.

  • Fix participating_in filter incorrectly including competitions the user organizes: creators/collaborators are auto-added as approved participants (Competition.save()), so they leaked into the Participating tab.

  • Applied the same fix to the public competitions endpoint's participating_in filter and updated its tests.

  • Added coverage for the list endpoint's pagination and participating_in behavior.

  • Minor renames for clarity (change_page, tab labels).

Issues this PR resolves

Screenshots

Organizing Tab pagination
Screenshot 2026-08-07 at 5 52 41 PM

Participating Tab pagination
Screenshot 2026-08-07 at 5 52 46 PM

No pagination when api response has only 1 page
Screenshot 2026-08-07 at 5 52 56 PM

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

Paginate the competition list endpoint (LargePagination), and update
the Organizing/Participating tabs in competition_list.tag to
consume the new {count, next, previous, results} shape with
next/previous buttons (hidden on a single page). Fix the navbar
competition search to read response.results instead of assuming a
bare array.

Fix participating_in filter incorrectly including competitions the
user organizes: creators/collaborators are auto-added as approved
participants (Competition.save()), so they leaked into the
Participating tab. Applied the same fix to the public competitions
endpoint's participating_in filter and updated its tests. Added
coverage for the list endpoint's pagination and participating_in
behavior. Minor renames for clarity (change_page, tab labels).
@ihsaan-ullah ihsaan-ullah linked an issue Aug 7, 2026 that may be closed by this pull request
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.

Improve Codabench competitions api

1 participant