Fix #74 -- Warn if quota exceeds after payment

This commit is contained in:
Raphael Michel
2017-01-04 19:19:58 +01:00
parent 847997ea9b
commit b23d95b6c3
8 changed files with 74 additions and 12 deletions

View File

@@ -39,10 +39,15 @@ def pretixcontrol_logentry_display(sender, logentry, **kwargs):
@receiver(signal=requiredaction_display, dispatch_uid="paypal_requiredaction_display")
def pretixcontrol_action_display(sender, action, request, **kwargs):
if action.action_type != 'pretix.plugins.paypal.refund':
if not action.action_type.startswith('pretix.plugins.paypal'):
return
data = json.loads(action.data)
template = get_template('pretixplugins/paypal/action_refund.html')
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')
ctx = {'data': data, 'event': sender, 'action': action}
return template.render(ctx, request)