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>

View File

@@ -32,7 +32,6 @@ from pretix.base.forms import SecretKeySettingsField
from pretix.base.settings import settings_hierarkey
from pretix.base.signals import (
logentry_display, register_global_settings, register_payment_providers,
requiredaction_display,
)
from pretix.control.signals import nav_organizer
from pretix.plugins.stripe.forms import StripeKeyValidator
@@ -164,25 +163,6 @@ def register_global_settings(sender, **kwargs):
])
@receiver(signal=requiredaction_display, dispatch_uid="stripe_requiredaction_display")
def pretixcontrol_action_display(sender, action, request, **kwargs):
# DEPRECATED
if not action.action_type.startswith('pretix.plugins.stripe'):
return
data = json.loads(action.data)
if action.action_type == 'pretix.plugins.stripe.refund':
template = get_template('pretixplugins/stripe/action_refund.html')
elif action.action_type == 'pretix.plugins.stripe.overpaid':
template = get_template('pretixplugins/stripe/action_overpaid.html')
elif action.action_type == 'pretix.plugins.stripe.double':
template = get_template('pretixplugins/stripe/action_double.html')
ctx = {'data': data, 'event': sender, 'action': action}
return template.render(ctx, request)
@receiver(nav_organizer, dispatch_uid="stripe_nav_organizer")
def nav_o(sender, request, organizer, **kwargs):
if request.user.has_active_staff_session(request.session.session_key):

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 charge=data.charge stripe_href="href='https://dashboard.stripe.com/payments/"|add:data.charge|add:"' target='_blank'"|safe order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
The Stripe transaction <a {{ stripe_href }}>{{ charge }}</a> has succeeded, but the order {{ order }} has
already been paid by other means. Please double-check and refund the money via Stripe'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 charge=data.charge stripe_href="href='https://dashboard.stripe.com/payments/"|add:data.charge|add:"' target='_blank'"|safe order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
The Stripe transaction <a {{ stripe_href }}>{{ charge }}</a> 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 Stripe'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 charge=data.charge stripe_href="href='https://dashboard.stripe.com/payments/"|add:data.charge|add:"' target='_blank'"|safe order="<a href='"|add:ourl|add:"'>"|add:data.order|add:"</a>"|safe %}
Stripe reported that the transaction <a {{ stripe_href }}>{{ charge }}</a> has been refunded.
Do you want to refund mark the matching order ({{ order }}) as refunded?
{% endblocktrans %}
</p>