pretix/pretix-passbook

AttributeError when pressing preview

Opened this issue · 3 comments

ligi commented

I could install the plugin - then I selected 2 images and pressed preview. Then I got this error-page:

AttributeError at /control/event/bigevents/2017/settings/tickets/preview/passbook
'NoneType' object has no attribute 'name'
Request Method:	GET
Request URL:	http://localhost:8000/control/event/bigevents/2017/settings/tickets/preview/passbook
Django Version:	1.10.3
Exception Type:	AttributeError
Exception Value:	
'NoneType' object has no attribute 'name'
Exception Location:	/home/ligi/git/3rd/pretix/local/pretix-passbook/pretix_passbook/passbook.py in generate, line 105
Python Executable:	/usr/bin/python3
Python Version:	3.5.2
Python Path:	
['/home/ligi/git/3rd/pretix/src',
 '/usr/lib/python35.zip',
 '/usr/lib/python3.5',
 '/usr/lib/python3.5/plat-x86_64-linux-gnu',
 '/usr/lib/python3.5/lib-dynload',
 '/home/ligi/.local/lib/python3.5/site-packages',
 '/usr/local/lib/python3.5/dist-packages',
 '/home/ligi/git/3rd/pretix/local/pretix-passbook',
 '/usr/local/lib/python3.5/dist-packages/wallet_py3k-0.0.3-py3.5.egg',
 '/usr/lib/python3/dist-packages',
 '/home/ligi/git/3rd/pretix/src']
Server time:	Wed, 2 Nov 2016 19:48:55 +0000

Environment:


Request Method: GET
Request URL: http://localhost:8000/control/event/bigevents/2017/settings/tickets/preview/passbook

Django Version: 1.10.3
Python Version: 3.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'pretix.base',
 'pretix.control',
 'pretix.presale',
 'pretix.multidomain',
 'compressor',
 'bootstrap3',
 'djangoformsetjs',
 'pretix.plugins.banktransfer',
 'pretix.plugins.stripe',
 'pretix.plugins.paypal',
 'pretix.plugins.ticketoutputpdf',
 'pretix.plugins.sendmail',
 'pretix.plugins.statistics',
 'pretix.plugins.reports',
 'pretix.plugins.checkinlists',
 'pretix.plugins.pretixdroid',
 'easy_thumbnails',
 'django_markup',
 'django_otp',
 'django_otp.plugins.otp_totp',
 'django_otp.plugins.otp_static',
 'pretix_passbook',
 'debug_toolbar.apps.DebugToolbarConfig']
Installed Middleware:
['pretix.multidomain.middlewares.MultiDomainMiddleware',
 'pretix.multidomain.middlewares.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'pretix.multidomain.middlewares.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'pretix.control.middleware.PermissionMiddleware',
 'pretix.base.middleware.LocaleMiddleware',
 'pretix.presale.middleware.EventMiddleware',
 'pretix.base.middleware.SecurityMiddleware',
 'pretix.helpers.debug.DebugMiddlewareCompatibilityShim']



Traceback:

File "/home/ligi/.local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/home/ligi/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/home/ligi/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/ligi/git/3rd/pretix/src/pretix/control/permissions.py" in wrapper
  32.                     return function(request, *args, **kw)

File "/home/ligi/.local/lib/python3.5/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/home/ligi/.local/lib/python3.5/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/home/ligi/git/3rd/pretix/src/pretix/control/views/event.py" in get
  398.         fname, mimet, data = tickets.preview(self.request.event.pk, self.output.identifier)

File "/home/ligi/git/3rd/pretix/src/pretix/base/services/tickets.py" in preview
  58.                 return prov.generate(p)

File "/home/ligi/git/3rd/pretix/local/pretix-passbook/pretix_passbook/passbook.py" in generate
  105.         passfile.addFile('icon.png', default_storage.open(icon_file.name, 'rb'))

Exception Type: AttributeError at /control/event/bigevents/2017/settings/tickets/preview/passbook
Exception Value: 'NoneType' object has no attribute 'name'

might be related to #7

have you been able to fix that (unsure what your email refered to)?

ligi commented

No - but I just found the general settings where to upload the certs. Now I have to find out where to get these certs without creating a apple account..
But this should be treated as a bug regardless - if these files are not uploaded the preview should not be available.

I don't know if you'll find any valid certs without an apple account. :/ You can upload any RSA private key and X509 certificate compatible with SMIME, it just won't work on Apple devices then.
(But if you create your esPass plugin, you can probably throw away all of this anyway.)