Define LogEntryTypes for all actions in pretix core, improve content_object handling (#4768)

Create LogEntryType definitions for all missing action_types (order changes, check-in events, settings changes of PaymentProviders and TicketOutputs).

Check whether the stored content_object is of the expected model type, preventing incorrect links.

Refactoring:
-    Move the base LogEntryType definitions for our models to their own file
-    Move HTML escaping into make_link to make it less likely to oversee in the LogEntryType definitions
-    Log pretix.event.order.deleted with the deleted Order model as content_object, matching the other *.deleted action_types
This commit is contained in:
Mira
2025-01-24 10:05:19 +01:00
committed by GitHub
parent 0a23aeece4
commit 832f4e4d68
6 changed files with 512 additions and 403 deletions

View File

@@ -40,7 +40,7 @@ from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.functional import cached_property
from pretix.base.logentrytypes import log_entry_types, make_link
from pretix.base.logentrytype_registry import log_entry_types, make_link
from pretix.base.signals import is_app_active, logentry_object_link
@@ -93,7 +93,7 @@ class LogEntry(models.Model):
def display(self):
log_entry_type, meta = log_entry_types.get(action_type=self.action_type)
if log_entry_type:
return log_entry_type.display(self)
return log_entry_type.display(self, self.parsed_data)
from ..signals import logentry_display