Open pc-coholic opened 6 years ago
Background from #1:
I do not know, why the template is not found - but even if it was found, so far the Preview-Feature is not properly implemented yet.
Some technical background:
A regular ticketgenerator-plugin has a
generate()
-method, that takes an orderPosition as parameter and returns the generated ticket for the passed position. When you click the download-button in the frontend,<url of the order>/<orderposition>/<generatorname>
is navigated to, and the abovegenerate()
-function is called, and you get your ticket. If you click on the preview-button in the backend, the function is called but a fake orderPosition is passed.However, this plugin is doing things a little bit different in order to allow participants to give informed consent before having their data transmitted to Google.
The
generate()
-function for this plugin is generally not being called except as a fallback. In the frontend, clicks on the Download-Button are being rewritten to display a modal message that includes a button to<url of the order>/<orderposition>/googlepaypasses/generate
(instead of the original<url of the order>/<orderposition>/googlepaypasses
. Calling the URL without the/generate
will show the consent-message, assuming that the user hasn't seen it (disabled Javascript, etc.).That means, that we're pretty much ignoring whatever orderPosition is passed to
generate()
. Only when calling/generate
, we extract the orderPosition from the URL, generate the pass and return it to the user.So this is also the reason, why the preview-feature wouldn't work - even if the template was found: we would only return a HTML-file with the consent-message, linking to a
/generate
that won't be doing anything.Long story, short: As of now, if you want to see a pass, you have to generate it through the frontend.
But see - that's one of the reasons I was reluctant to upload all the resources to have this half-done plugin run into this kind of issues ;)
With recent changes to pretix, it seems like calling the Preview will not cause the reported error anymore.
However, as it is customary for this plugin, the download-fallback page is rendered and offered for download.
At this point, I'll relabel this issue as enhancement, display a corresponding message that previews are not available, and move the implementation of the preview-mode to a later date.
As the passed orderPosition
is fictitious, the "click this button to get your pass"-button won't be functional, as the system will try to lookup an order with the ID "PREVIEW1234" and a random secret - but obviously failing.
When using the preview ticket option I get this Dijango error
When testing it with a "real" (Brought via shop) ticket I get this
Originally posted by @LordBonzi in https://github.com/pc-coholic/pretix-googlepaypasses/issues/1#issuecomment-434730283