Skip to content

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

Merged
ObadaS merged 1 commit into
developfrom
competiitons_api
Sep 8, 2026
Merged

ObadaS merged 1 commit into
developfrom
competiitons_api

Conversation

@ihsaan-ullah

@ihsaan-ullah ihsaan-ullah commented Aug 7, 2026 •

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

@ihsaan-ullah ihsaan-ullah linked an issue Aug 7, 2026 that may be closed by this pull request
@Didayolo
Didayolo requested a review from IdirLISN September 8, 2026 13:18

@IdirLISN IdirLISN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codereviewed, hand tested

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).
@ObadaS
ObadaS merged commit ad07165 into develop Sep 8, 2026
2 checks passed
@ObadaS
ObadaS deleted the competiitons_api branch September 8, 2026 13:45
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

3 participants