Use a defaultdict for log rendering

This commit is contained in:
Raphael Michel
2018-08-07 12:19:00 +02:00
parent a5159ce8e1
commit 423810cf61

View File

@@ -1,4 +1,5 @@
import json
from collections import defaultdict
from decimal import Decimal
import bleach
@@ -281,6 +282,7 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
data['value'] = LazyI18nString(data['value'])
if logentry.action_type in plains:
data = defaultdict(lambda: '?', data)
return plains[logentry.action_type].format_map(data)
if logentry.action_type.startswith('pretix.event.order.changed'):