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

@@ -150,31 +150,6 @@ def get_all_notification_types(event=None):
return types
class ActionRequiredNotificationType(NotificationType):
required_permission = "can_change_orders"
action_type = "pretix.event.action_required"
verbose_name = _("Administrative action required")
def build_notification(self, logentry: LogEntry):
control_url = build_absolute_uri(
'control:event.requiredactions',
kwargs={
'organizer': logentry.event.organizer.slug,
'event': logentry.event.slug,
}
)
n = Notification(
event=logentry.event,
title=_('Administrative action required'),
detail=_('Something happened in your event that our system cannot handle automatically, e.g. an external '
'refund. You need to resolve it manually or choose to ignore it, depending on the issue at hand.'),
url=control_url
)
n.add_action(_('View all unresolved problems'), control_url)
return n
class ParametrizedOrderNotificationType(NotificationType):
required_permission = "can_view_orders"
@@ -324,7 +299,4 @@ def register_default_notification_types(sender, **kwargs):
_('Refund requested'),
_('You have been requested to issue a refund for {order.code}.')
),
ActionRequiredNotificationType(
sender,
)
)