Skip to content

fix: check-in review round 3 — unused logger, JSON validation, query optimization#55

Merged
JacobCoffee merged 1 commit intomainfrom
fix/checkin-review-round3
Mar 19, 2026
Merged

fix: check-in review round 3 — unused logger, JSON validation, query optimization#55
JacobCoffee merged 1 commit intomainfrom
fix/checkin-review-round3

Conversation

@JacobCoffee
Copy link
Copy Markdown
Owner

Summary

  • Remove unused logging import and logger variable from views_checkin.py
  • Validate _parse_json_body() returns a dict, not just any JSON value (arrays/strings would cause AttributeError on .get())
  • Replace Attendee.objects.filter(checkins__isnull=False).distinct().count() with filter(checked_in_at__isnull=False).count() in dashboard — avoids join+distinct since checked_in_at is already set on first check-in

Test plan

  • 42 check-in tests pass
  • Lint/format pass

🤖 Generated with Claude Code

…in_count query

- Remove unused logging import and logger in views_checkin.py
- Validate _parse_json_body returns a dict (reject arrays/strings)
- Use checked_in_at__isnull=False instead of join+distinct for dashboard count

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 19, 2026 03:38
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens the staff check-in API’s JSON handling and improves dashboard query efficiency, while also cleaning up unused logging artifacts in the registration check-in views.

Changes:

  • Removed an unused logging import and logger from the registration check-in API views.
  • Updated _parse_json_body() to only accept JSON objects (dicts), returning None for non-object JSON payloads.
  • Optimized the check-in dashboard “checked in” count query to use Attendee.checked_in_at instead of a join + distinct().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/django_program/registration/views_checkin.py Removes unused logging and hardens JSON body parsing to require an object payload.
src/django_program/manage/views_checkin.py Replaces a join-based distinct count with a direct checked_in_at filter for better performance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JacobCoffee JacobCoffee reopened this Mar 19, 2026
@JacobCoffee JacobCoffee merged commit 1167f27 into main Mar 19, 2026
17 of 20 checks passed
@JacobCoffee JacobCoffee deleted the fix/checkin-review-round3 branch March 19, 2026 13:37
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.

2 participants