Skip to content

Commit

Permalink
update to 2.0; remove segno/qrcode
Browse files Browse the repository at this point in the history
  • Loading branch information
pc-coholic committed Aug 6, 2018
1 parent 8a20cfd commit 9f20d1c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
10 changes: 9 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ In the plugin settings you can set a custom text which will not only be displaye

Please note, that you will have to mark the orders as payed by hand using the pretix backend. You may also - at your own risk - use the `pretix-cashpoint`_ in conjunction with the `de.pccoholic.pretix.cashpoint`_ android app to mark tickets as payed.

Compatibility
-------------
As major versions in pretix tend to also include major changes, compatibility can be difficult to maintain.

In order to make things simpler, the versioning of this plugin is also orienting itself on the versioning of pretix.

On other words: If you are running pretix 1.x, you should only install this plugin in a 1.x-version. The 2.x-version *might* work just fine, but is implementing pretix 2.x-functionality, which might not be available on legacy systems or might even break it.

Production setup - pip method
-----------------------------

Expand Down Expand Up @@ -57,7 +65,7 @@ Development setup
License
-------

Copyright 2017 Martin Gross
Copyright 2018 Martin Gross

Released under the terms of the Apache License 2.0

Expand Down
2 changes: 1 addition & 1 deletion pretix_cashpayment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PretixPluginMeta:
author = 'Martin Gross'
description = _('This plugin allows you to offer your customers a "pay with cash at the venue" option.')
visible = True
version = '1.0.2'
version = '2.0.0'

def ready(self):
from . import signals # NOQA
Expand Down
6 changes: 0 additions & 6 deletions pretix_cashpayment/payment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections import OrderedDict

import segno
from django.http import HttpRequest
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -54,16 +53,11 @@ def order_pending_mail_render(self, order) -> str:
return template.render(ctx)

def payment_pending_render(self, request: HttpRequest, payment: OrderPayment):
if 'pretix_cashpoint' in self.event.get_plugins():
qrcode = segno.make_qr(payment.order.full_code, error='H').png_data_uri(scale=10, border=0)
else:
qrcode = None
template = get_template('pretix_cashpayment/pending.html')
ctx = {
'event': self.event,
'order': payment.order,
'information_text': self.settings.get('information_text', as_type=LazyI18nString),
'qrcode': qrcode,
}
return template.render(ctx)

Expand Down
3 changes: 0 additions & 3 deletions pretix_cashpayment/templates/pretix_cashpayment/pending.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
<br />
{% trans "Amount:" %} {{ order.total|localize }} {{ event.currency }}<br />
<strong>{% trans "Reference code (important):" %} {{ order.full_code }}</strong><br />
{% if qrcode %}
<img class="img-responsive center-block" src="{{ qrcode }}" />
{% endif %}
</address>
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def run(self):

setup(
name='pretix-cashpayment',
version='1.0.2',
version='2.0.0',
description='pretix plugin that allows you to offer your customers a "pay with cash at the venue" option.',
long_description=long_description,
url='http://www.github.com/pc-coholic/pretix-cashpayment',
author='Martin Gross',
author_email='[email protected]',
license='Apache Software License',

install_requires=['segno'],
install_requires=[],
packages=find_packages(exclude=['tests', 'tests.*']),
include_package_data=True,
cmdclass=cmdclass,
Expand Down

0 comments on commit 9f20d1c

Please sign in to comment.