fix: check-in review round 3 — unused logger, JSON validation, query optimization#55
Merged
JacobCoffee merged 1 commit intomainfrom Mar 19, 2026
Merged
Conversation
…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>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
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
loggingimport andloggerfrom the registration check-in API views. - Updated
_parse_json_body()to only accept JSON objects (dicts), returningNonefor non-object JSON payloads. - Optimized the check-in dashboard “checked in” count query to use
Attendee.checked_in_atinstead 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loggingimport andloggervariable fromviews_checkin.py_parse_json_body()returns a dict, not just any JSON value (arrays/strings would cause AttributeError on.get())Attendee.objects.filter(checkins__isnull=False).distinct().count()withfilter(checked_in_at__isnull=False).count()in dashboard — avoids join+distinct sincechecked_in_atis already set on first check-inTest plan
🤖 Generated with Claude Code