diff --git a/doc/development/api/quality.rst b/doc/development/api/quality.rst index 46ff5e1fcc..26fff4e906 100644 --- a/doc/development/api/quality.rst +++ b/doc/development/api/quality.rst @@ -94,7 +94,7 @@ F. Functionality #. Refunds are implemented, if possible. - #. In case of overpayment or external refunds, a "required action" is created to notify the event organizer. + #. In case of overpayment or external refunds, an external refund is properly created. #. If the plugin adds steps to the checkout process, it has been tested in combination with the pretix widget. diff --git a/doc/development/implementation/models.rst b/doc/development/implementation/models.rst index 99f5a8b590..c5cae26161 100644 --- a/doc/development/implementation/models.rst +++ b/doc/development/implementation/models.rst @@ -34,9 +34,6 @@ Organizers and events .. autoclass:: pretix.base.models.TeamAPIToken :members: -.. autoclass:: pretix.base.models.RequiredAction - :members: - .. autoclass:: pretix.base.models.EventMetaProperty :members: diff --git a/src/pretix/base/migrations/0188_delete_requiredaction.py b/src/pretix/base/migrations/0188_delete_requiredaction.py new file mode 100644 index 0000000000..1047d1077b --- /dev/null +++ b/src/pretix/base/migrations/0188_delete_requiredaction.py @@ -0,0 +1,16 @@ +# Generated by Django 3.2.2 on 2021-05-13 18:20 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0187_normalize_salutation'), + ] + + operations = [ + migrations.DeleteModel( + name='RequiredAction', + ), + ] diff --git a/src/pretix/base/models/__init__.py b/src/pretix/base/models/__init__.py index 9f5d805ec0..e90e0c6f92 100644 --- a/src/pretix/base/models/__init__.py +++ b/src/pretix/base/models/__init__.py @@ -27,7 +27,7 @@ from .customers import Customer from .devices import Device, Gate from .event import ( Event, Event_SettingsStore, EventLock, EventMetaProperty, EventMetaValue, - RequiredAction, SubEvent, SubEventMetaValue, generate_invite_token, + SubEvent, SubEventMetaValue, generate_invite_token, ) from .giftcards import GiftCard, GiftCardAcceptance, GiftCardTransaction from .invoices import Invoice, InvoiceLine, invoice_filename diff --git a/src/pretix/base/models/event.py b/src/pretix/base/models/event.py index 192b8940c0..646937f2ee 100644 --- a/src/pretix/base/models/event.py +++ b/src/pretix/base/models/event.py @@ -1389,60 +1389,6 @@ class EventLock(models.Model): token = models.UUIDField(default=uuid.uuid4) -class RequiredAction(models.Model): - """ - Represents an action that is to be done by an admin. The admin will be - displayed a list of actions to do. - - :param datatime: The timestamp of the required action - :type datetime: datetime - :param user: The user that performed the action - :type user: User - :param done: If this action has been completed or dismissed - :type done: bool - :param action_type: The type of action that has to be performed. This is - used to look up the renderer used to describe the action in a human- - readable way. This should be some namespaced value using dotted - notation to avoid duplicates, e.g. - ``"pretix.plugins.banktransfer.incoming_transfer"``. - :type action_type: str - :param data: Arbitrary data that can be used by the log action renderer - :type data: str - """ - datetime = models.DateTimeField(auto_now_add=True, db_index=True) - done = models.BooleanField(default=False) - user = models.ForeignKey('User', null=True, blank=True, on_delete=models.PROTECT) - event = models.ForeignKey('Event', null=True, blank=True, on_delete=models.CASCADE) - action_type = models.CharField(max_length=255) - data = models.TextField(default='{}') - - class Meta: - ordering = ('datetime',) - - def display(self, request): - from ..signals import requiredaction_display - - for receiver, response in requiredaction_display.send(self.event, action=self, request=request): - if response: - return response - return self.action_type - - def save(self, *args, **kwargs): - created = not self.pk - super().save(*args, **kwargs) - if created: - from ..services.notifications import notify - from .log import LogEntry - - logentry = LogEntry.objects.create( - content_object=self, - action_type='pretix.event.action_required', - event=self.event, - visible=False - ) - notify.apply_async(args=(logentry.pk,)) - - class EventMetaProperty(LoggedModel): """ An organizer account can have EventMetaProperty objects attached to define meta information fields diff --git a/src/pretix/base/notifications.py b/src/pretix/base/notifications.py index 58c67eceb5..f4f6617861 100644 --- a/src/pretix/base/notifications.py +++ b/src/pretix/base/notifications.py @@ -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, - ) ) diff --git a/src/pretix/base/signals.py b/src/pretix/base/signals.py index b044db101e..634a1ea417 100644 --- a/src/pretix/base/signals.py +++ b/src/pretix/base/signals.py @@ -502,16 +502,7 @@ As with all event-plugin signals, the ``sender`` keyword argument will contain t requiredaction_display = EventPluginSignal() """ -Arguments: ``action``, ``request`` - -To display an instance of the ``RequiredAction`` model to a human user, -``pretix.base.signals.requiredaction_display`` will be sent out with a ``action`` argument. -You will also get the current ``request`` in a different argument. - -The first received response that is not ``None`` will be used to display the log entry -to the user. The receivers are expected to return HTML code. - -As with all event-plugin signals, the ``sender`` keyword argument will contain the event. +**DEPRECATED**, will no longer be called. """ event_copy_data = EventPluginSignal() diff --git a/src/pretix/control/templates/pretixcontrol/event/actions.html b/src/pretix/control/templates/pretixcontrol/event/actions.html deleted file mode 100644 index 155c02a5fc..0000000000 --- a/src/pretix/control/templates/pretixcontrol/event/actions.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "pretixcontrol/items/base.html" %} -{% load i18n %} -{% block title %}{% trans "Current issues" %}{% endblock %} -{% block inside %} -
- - {% trans "Hide message" %} - - {{ action.datetime|date:"SHORT_DATETIME_FORMAT" }} -
- {{ action.display|safe }} -- - {% trans "Hide message" %} - - {{ action.datetime|date:"SHORT_DATETIME_FORMAT" }} - -
- {{ action.display|safe }} -