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

@@ -355,7 +355,7 @@ class Order(LockModel, LoggedModel):
if not self.testmode:
raise TypeError("Only test mode orders can be deleted.")
self.event.log_action(
self.log_action(
'pretix.event.order.deleted', user=user, auth=auth,
data={
'code': self.code,