Remove RequiredAction model (#2078)

This commit is contained in:
Raphael Michel
2021-05-17 17:41:59 +02:00
committed by GitHub
parent 04dd2a6cf0
commit f19a74990f
21 changed files with 23 additions and 310 deletions

View File

@@ -24,13 +24,11 @@ from collections import OrderedDict
from django import forms
from django.dispatch import receiver
from django.template.loader import get_template
from django.utils.translation import gettext_lazy as _
from pretix.base.forms import SecretKeySettingsField
from pretix.base.signals import (
logentry_display, register_global_settings, register_payment_providers,
requiredaction_display,
)
@@ -65,24 +63,6 @@ def pretixcontrol_logentry_display(sender, logentry, **kwargs):
return _('PayPal reported an event: {}').format(text)
@receiver(signal=requiredaction_display, dispatch_uid="paypal_requiredaction_display")
def pretixcontrol_action_display(sender, action, request, **kwargs):
if not action.action_type.startswith('pretix.plugins.paypal'):
return
data = json.loads(action.data)
if action.action_type == 'pretix.plugins.paypal.refund':
template = get_template('pretixplugins/paypal/action_refund.html')
elif action.action_type == 'pretix.plugins.paypal.overpaid':
template = get_template('pretixplugins/paypal/action_overpaid.html')
elif action.action_type == 'pretix.plugins.paypal.double':
template = get_template('pretixplugins/paypal/action_double.html')
ctx = {'data': data, 'event': sender, 'action': action}
return template.render(ctx, request)
@receiver(register_global_settings, dispatch_uid='paypal_global_settings')
def register_global_settings(sender, **kwargs):
return OrderedDict([

View File

@@ -1,9 +0,0 @@
{% load i18n %}
<p>
{% url "control:event.order" organizer=event.organizer.slug event=event.slug code=data.order as ourl %}
{% blocktrans trimmed with payment=data.payment order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
The PayPal transaction {{ payment }} has succeeded, but the order {{ order }} has already been paid by other
means. Please double check and refund the money via PayPal's interface.
{% endblocktrans %}
</p>

View File

@@ -1,10 +0,0 @@
{% load i18n %}
<p>
{% url "control:event.order" organizer=event.organizer.slug event=event.slug code=data.order as ourl %}
{% blocktrans trimmed with payment=data.payment order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
The PayPal transaction {{ payment }} has succeeded, but the order {{ order }} is expired and the product
was sold out in the meantime. Therefore, the payment could not be accepted. Please contact the user and refund
the money via PayPal's interface.
{% endblocktrans %}
</p>

View File

@@ -1,9 +0,0 @@
{% load i18n %}
<p>
{% url "control:event.order" organizer=event.organizer.slug event=event.slug code=data.order as ourl %}
{% blocktrans trimmed with payment=data.resource.id order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
PayPal reported that the payment {{ payment }} has been refunded or reversed.
Do you want to mark the matching order ({{ order }}) as refunded?
{% endblocktrans %}
</p>