Skip to content

Commit

Permalink
Merge pull request #11 from pretix/master
Browse files Browse the repository at this point in the history
Django 3.0 Updates
  • Loading branch information
pc-coholic authored Apr 17, 2020
2 parents 2397e64 + 0bd1c63 commit ce8201f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pretix_cashpayment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

class PluginApp(AppConfig):
name = 'pretix_cashpayment'
Expand All @@ -9,6 +9,7 @@ class PretixPluginMeta:
name = _('Cash Payment')
author = 'Martin Gross'
description = _('This plugin allows you to offer your customers a "pay with cash at the venue" option.')
category = 'PAYMENT'
visible = True
version = '2.0.1'

Expand Down
7 changes: 6 additions & 1 deletion pretix_cashpayment/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.http import HttpRequest
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from i18nfield.fields import I18nFormField, I18nTextarea
from i18nfield.strings import LazyI18nString

Expand All @@ -15,6 +15,11 @@ class CashPayment(BasePaymentProvider):
verbose_name = _('Cash Payment')
abort_pending_allowed = True

@property
def test_mode_message(self):
return _('In test mode, you can just manually mark this order as paid in the backend after it has been '
'created.')

@property
def settings_form_fields(self):
form_field = I18nFormField(
Expand Down
4 changes: 2 additions & 2 deletions pretix_cashpayment/signals.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from pretix.base.signals import register_payment_providers
from django.dispatch import receiver
from pretix.base.settings import settings_hierarkey
from django.utils.translation import ugettext_lazy as _, ugettext_noop
from django.utils.translation import gettext_lazy as _, gettext_noop
from i18nfield.strings import LazyI18nString

@receiver(register_payment_providers, dispatch_uid="payment_cash")
def register_payment_provider(sender, **kwargs):
from .payment import CashPayment
return CashPayment

settings_hierarkey.add_default('payment_cashpayment_information_text', LazyI18nString.from_gettext(ugettext_noop(
settings_hierarkey.add_default('payment_cashpayment_information_text', LazyI18nString.from_gettext(gettext_noop(
"You can pay your order by cash at the venue."
)), LazyI18nString)

0 comments on commit ce8201f

Please sign in to comment.