Skip to content

Fix ?unclaimed filter to restrict to active-round specs only#80

Merged
PunchTheDev merged 1 commit into
mainfrom
punch/unclaimed-active-only
Jun 4, 2026
Merged

Fix ?unclaimed filter to restrict to active-round specs only#80
PunchTheDev merged 1 commit into
mainfrom
punch/unclaimed-active-only

Conversation

@PunchTheDev
Copy link
Copy Markdown
Owner

Summary

GET /specs?unclaimed=true was returning 108 results (all specs with no passing submission, including inactive Thingiverse catalog entries) instead of the 42 active competition specs with no SOTA. Fixed by implicitly applying the active-round filter when unclaimed=True.

Changes

  • app/routes/specs.py: unclaimed=True now implies active=True — restricts to specs whose round_id is in an active round. Non-competition specs (Thingiverse catalog, round_id=None) are never "claimable" in competition context.
  • Tests updated: three unclaimed-filter tests now use a dedicated unclaimed_client fixture with SPECS_DIR=tests/fixtures/specs_round (contains r01_001_easy, which has round_id=round_001 via ID prefix) and ROUNDS_DIR=tests/fixtures/rounds_active.
  • New fixture: tests/fixtures/specs_round/r01_001_easy.json.
  • conftest.py _make_client() now also reloads app.specs to prevent module-level SPECS_DIR stale reads across tests.

@PunchTheDev PunchTheDev merged commit 792d491 into main Jun 4, 2026
1 check passed
@PunchTheDev PunchTheDev deleted the punch/unclaimed-active-only branch June 4, 2026 03:18
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