eventyay-tickets
eventyay-tickets copied to clipboard
Unified QR response
This PR tries to Solve Issue #191 (Integrate Check-in and Lead Scanning into a Single QR Code)
Since both the codes are generated on a order they are now embedded into a single QR in the following json format
{
"ticket": "5uhbd49wms2fakafn5nzq7pcqpbjun2v",
"lead": "PZD97WTMFJ"
}
Summary by Sourcery
Unify the QR code generation by embedding both the ticket and lead information into a single JSON object, allowing for integrated check-in and lead scanning functionality.
New Features:
- Integrate check-in and lead scanning into a single QR code by embedding both codes into a unified JSON format.
Reviewer's Guide by Sourcery
This pull request implements a unified QR code response that combines both check-in and lead scanning information into a single QR code. The changes are made in the src/pretix/base/pdf.py file, specifically in the _draw_barcodearea method. The implementation replaces the previous conditional logic for setting the QR code content with a new approach that creates a JSON object containing both the ticket secret and the lead scanning pseudonymization ID.
File-Level Changes
| Files | Changes |
|---|---|
src/pretix/base/pdf.py |
Replace conditional content assignment with a dictionary containing both ticket and lead information |
src/pretix/base/pdf.py |
Convert the content dictionary to a JSON string for QR code generation |
Tips
- Trigger a new Sourcery review by commenting
@sourcery-ai reviewon the pull request. - Continue your discussion with Sourcery by replying directly to review comments.
- You can change your review settings at any time by accessing your dashboard:
- Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
- Change the review language;
- You can always contact us if you have any questions or feedback.
I would recommend to have event id or something for scanner to check for validity locally first before calling for server.
This PR focuses on unifying two QR codes into one. In Open Event Checkin, the QR code will only be scanned after the device is authenticated and the event is selected for check-in. Once the device is authenticated, the list of events becomes available to the scanner.
Could you please clarify how incorporating the event ID for local validity checks before calling the server might work with this process?
@Sak1012 assuming there's no eventid to reference the selected event to scan, every request, even those qr without the right keys, gets sent to the server which are unwanted. If you have 10,000 devices sending json to server for checks, with and without ticket id field, do you think there will be a bottleneck on the server from returning "ticket key not found" / "ticket is not for this event" kind of error?
I have modified it so that it now includes the eventname. The response would now look like
{
"event": "EventName",
"ticket": "5uhbd49wms2fakafn5nzq7pcqpbjun2v",
"lead": "PZD97WTMFJ"
}
I have modified it so that it now includes the eventname. The response would now look like
{ "event": "EventName", "ticket": "5uhbd49wms2fakafn5nzq7pcqpbjun2v", "lead": "PZD97WTMFJ" }
this is based on the assumption that no event name are equal under the same account. will you have checks on the event creation side that no dup names exist?
I think it would be better to use a unique event-ID.
Since there is no particular "event_id" for events in eventyay-tickets can event-slug and organiser be used instead, as they are unique values and by checking both of them it can be made sure it's unique and accurate for the particular event before sending the request to the server.
So the embedded data would look like
{
"event": "event_slug",
"org": "organiser",
"ticket": "5uhbd49wms2fakafn5nzq7pcqpbjun2v",
"lead": "PZD97WTMFJ"
}