Closed bonzi closed 6 years ago
After installing manually by cloning and running setup.py install
it stated the walletobjects
module was not installed, I'm guessing it is referring to this, currently empty repo
Hello!
You pretty much already figured it out correctly - without the walletobjects-repo this is not working yet.
There are still a number of issues with this plugin which make it not a good choice for production use - hence also the disclaimer on the plugin's README. I will however push a Work-In-Progress version of the walletobjects.
The wheel-thing is an unrelated issue with Django 2.0 compatibility - I pushed a fix for that.
Please feel free to test the plugin if you want - but I cannot stress enough how I do not recommend using it for production use at this point.
Thanks for pushing a WIP walletobjects. This won't be going in to production as of yet (Not until it becomes "stable")
I'll report back my success, or lack thereof.
When using the preview ticket option I get this Dijango error
ERROR 2018-10-31 15:03:48,024 django.request log Internal Server Error: /control/event/LordBonzi/rulzc/settings/tickets/preview/googlepaypasses
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/permissions.py", line 27, in wrapper
return function(request, *args, **kw)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/views/event.py", line 670, in get
fname, mimet, data = tickets.preview(self.request.event.pk, self.output.identifier)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/services/tickets.py", line 100, in preview
return prov.generate(p)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses-1.0.0-py3.6.egg/pretix_googlepaypasses/googlepaypasses.py", line 98, in generate
tpl_html = get_template('pretix_googlepaypasses/downloadfallback.html')
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/loader.py", line 19, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/downloadfallback.html
ERROR 2018-10-31 15:03:48,024 django.request log Internal Server Error: /control/event/LordBonzi/rulzc/settings/tickets/preview/googlepaypasses
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/permissions.py", line 27, in wrapper
return function(request, *args, **kw)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/views/event.py", line 670, in get
fname, mimet, data = tickets.preview(self.request.event.pk, self.output.identifier)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/services/tickets.py", line 100, in preview
return prov.generate(p)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses-1.0.0-py3.6.egg/pretix_googlepaypasses/googlepaypasses.py", line 98, in generate
tpl_html = get_template('pretix_googlepaypasses/downloadfallback.html')
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/loader.py", line 19, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/downloadfallback.html
When testing it with a "real" (Brought via shop) ticket I get this
ERROR 2018-10-31 15:37:15,932 django.request log Internal Server Error: /LordBonzi/rulzc/order/order/secret/
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/base.py", line 169, in render
with context.bind_template(self):
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/context.py", line 246, in bind_template
updates.update(processor(self.request))
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/context.py", line 46, in contextprocessor
for receiver, response in html_head.send(request.event, request=request):
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/signals.py", line 70, in send
response = receiver(signal=self, sender=sender, **named)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses-1.0.0-py3.6.egg/pretix_googlepaypasses/signals.py", line 60, in html_head_presale
template = get_template('pretix_googlepaypasses/presale_head.html')
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/loader.py", line 19, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/presale_head.html
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
response = response.render()
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
content = template.render(context, self._request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 63, in render
reraise(exc, self.backend)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 84, in reraise
raise new from exc
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/presale_head.html
ERROR 2018-10-31 15:37:15,932 django.request log Internal Server Error: /LordBonzi/rulzc/order/order/secret/
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/base.py", line 169, in render
with context.bind_template(self):
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/context.py", line 246, in bind_template
updates.update(processor(self.request))
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/context.py", line 46, in contextprocessor
for receiver, response in html_head.send(request.event, request=request):
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/signals.py", line 70, in send
response = receiver(signal=self, sender=sender, **named)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses-1.0.0-py3.6.egg/pretix_googlepaypasses/signals.py", line 60, in html_head_presale
template = get_template('pretix_googlepaypasses/presale_head.html')
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/loader.py", line 19, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/presale_head.html
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
response = response.render()
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
content = template.render(context, self._request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 63, in render
reraise(exc, self.backend)
File "/var/pretix/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 84, in reraise
raise new from exc
django.template.exceptions.TemplateDoesNotExist: pretix_googlepaypasses/presale_head.html
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 above generate()
-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 ;)
Hi again,
I understand you reluctance to release the plugin, But after all, Isn't documenting your issues always good in-case others try to attempt to """"test"""" the plugin :yum:
As it turns out, these errors may be my own fault as the venv site-packages folder did not have the required plugin folders necessary, Note to self, Just use pip, save yourself the hassle.
The plugin seems to work - eg it installed, can be enabled and shows up on the order page and displays the Privacy Notice, However once clicking the "Add to Pay" button it sends a JSON error message
{"status": "error"}
No doubt this would be caused by some error on my part. Do you have an example of how to fill out the events settings page for the plugin?
Thanks
Also, When trying to save values for the plugins settings, It gives an error stating AttributeError: 'bool' object has no attribute 'get'
The full log is as follows
ERROR 2018-10-31 17:57:43,924 django.request log Internal Server Error: /control/event/LordBonzi/rulzc/settings/tickets
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/permissions.py", line 27, in wrapper
return function(request, *args, **kw)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/views/event.py", line 735, in post
for k in provider.form.changed_data
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/models/base.py", line 80, in log_action
logentry.save()
File "/var/pretix/venv/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save
force_update=force_update, update_fields=update_fields)
File "/var/pretix/venv/lib/python3.6/site-packages/django/db/models/base.py", line 758, in save_base
update_fields=update_fields, raw=raw, using=using,
File "/var/pretix/venv/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 175, in send
for receiver in self._live_receivers(sender)
File "/var/pretix/venv/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 175, in <listcomp>
for receiver in self._live_receivers(sender)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/signals.py", line 84, in logentry_post_save
if WalletobjectOutput.checkIfEventTicketClassExists(event, authedSession):
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 189, in checkIfEventTicketClassExists
result = authedSession.get(
AttributeError: 'bool' object has no attribute 'get'
ERROR 2018-10-31 17:57:43,924 django.request log Internal Server Error: /control/event/LordBonzi/rulzc/settings/tickets
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/permissions.py", line 27, in wrapper
return function(request, *args, **kw)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/control/views/event.py", line 735, in post
for k in provider.form.changed_data
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/base/models/base.py", line 80, in log_action
logentry.save()
File "/var/pretix/venv/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save
force_update=force_update, update_fields=update_fields)
File "/var/pretix/venv/lib/python3.6/site-packages/django/db/models/base.py", line 758, in save_base
update_fields=update_fields, raw=raw, using=using,
File "/var/pretix/venv/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 175, in send
for receiver in self._live_receivers(sender)
File "/var/pretix/venv/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 175, in <listcomp>
for receiver in self._live_receivers(sender)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/signals.py", line 84, in logentry_post_save
if WalletobjectOutput.checkIfEventTicketClassExists(event, authedSession):
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 189, in checkIfEventTicketClassExists
result = authedSession.get(
AttributeError: 'bool' object has no attribute 'get'
Did you set up the Issuer ID and Service-Account JSON in the global system settings?
That'd be probably wise of me to do, I've applied for a API Key and I am just waiting to be granted one. I'll report back my findings once it arrives.
Thanks
Hi again, I've gotten access to the API and have generated my Issuer ID and Service-Account JSON file and put them in the global settings. Now I get these errors in the pretix.log file instead of a JSON formatted error message
ERROR 2018-11-01 20:46:53,300 django.request log Internal Server Error: /LordBonzi/rulzc/order/CJDCT/j0amg4ef0an75qwp/download/27/googlepaypasses/generate
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/utils.py", line 114, in wrap
response = func(request=request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/utils.py", line 114, in wrap
response = func(request=request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/views/robots.py", line 7, in dispatch
resp = super().dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/views.py", line 35, in get
JWT = WalletobjectOutput.getWalletObjectJWT(self.order, kwargs['position'])
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 119, in getWalletObjectJWT
eventTicketClass = WalletobjectOutput.getOrgenerateEventTicketClass(order.event, authedSession)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 181, in getOrgenerateEventTicketClass
return WalletobjectOutput.generateEventTicketClass(event, authedSession)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 261, in generateEventTicketClass
event.name,
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/eventTicketClass.py", line 95, in heroImage
self._eventTicketClass['heroImage'] = utils.image(uri, description, localizedDescriptions, self._defaultLang)
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 74, in image
'sourceUri': utils.localizedUri(uri, description, stringsDict)
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 55, in localizedUri
'localizedDescription': utils.localizedString(stringsDict, default),
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 21, in localizedString
defaultLang = next(iter(stringsDict))
StopIteration
ERROR 2018-11-01 20:46:53,300 django.request log Internal Server Error: /LordBonzi/rulzc/order/CJDCT/j0amg4ef0an75qwp/download/27/googlepaypasses/generate
Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/pretix/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/utils.py", line 114, in wrap
response = func(request=request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/utils.py", line 114, in wrap
response = func(request=request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix/presale/views/robots.py", line 7, in dispatch
resp = super().dispatch(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/views.py", line 35, in get
JWT = WalletobjectOutput.getWalletObjectJWT(self.order, kwargs['position'])
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 119, in getWalletObjectJWT
eventTicketClass = WalletobjectOutput.getOrgenerateEventTicketClass(order.event, authedSession)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 181, in getOrgenerateEventTicketClass
return WalletobjectOutput.generateEventTicketClass(event, authedSession)
File "/var/pretix/venv/lib/python3.6/site-packages/pretix_googlepaypasses/googlepaypasses.py", line 261, in generateEventTicketClass
event.name,
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/eventTicketClass.py", line 95, in heroImage
self._eventTicketClass['heroImage'] = utils.image(uri, description, localizedDescriptions, self._defaultLang)
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 74, in image
'sourceUri': utils.localizedUri(uri, description, stringsDict)
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 55, in localizedUri
'localizedDescription': utils.localizedString(stringsDict, default),
File "/var/pretix/venv/lib/python3.6/site-packages/walletobjects/utils.py", line 21, in localizedString
defaultLang = next(iter(stringsDict))
StopIteration
Thanks again for all your help.
I haven't looked at this in too much detail as I'm on my phone right now...
But from just glancing at the trace, I would assume the problem to be in the walletobjects routine that builds localized Strings.
So a few things you could verify:
Hi again,
Only one language is enabled for said event. Strings should be present, but knowing me I'll have broken it some how. I'll have a check when I'm free.
Thanks
Hi there,
I tried to install the plugin but it failed to install when building wheels, I am using Python 3.6 in a venv. Any help will be greatly appreciated
My errors are as follows,