forked from CGM_Public/pretix_original
Fix obscure crash in log entry view
This commit is contained in:
@@ -440,7 +440,7 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
|
|||||||
bleach.clean(logentry.parsed_data.get('msg'), tags=[], strip=True)
|
bleach.clean(logentry.parsed_data.get('msg'), tags=[], strip=True)
|
||||||
)
|
)
|
||||||
|
|
||||||
if logentry.action_type.startswith('pretix.event.checkin'):
|
if sender and logentry.action_type.startswith('pretix.event.checkin'):
|
||||||
return _display_checkin(sender, logentry)
|
return _display_checkin(sender, logentry)
|
||||||
|
|
||||||
if logentry.action_type == 'pretix.control.views.checkin':
|
if logentry.action_type == 'pretix.control.views.checkin':
|
||||||
|
|||||||
@@ -751,7 +751,9 @@ class DeviceLogView(OrganizerDetailViewMixin, OrganizerPermissionRequiredMixin,
|
|||||||
qs = LogEntry.objects.filter(
|
qs = LogEntry.objects.filter(
|
||||||
device_id=self.device
|
device_id=self.device
|
||||||
).select_related(
|
).select_related(
|
||||||
'user', 'content_type', 'api_token', 'oauth_application', 'device', 'event'
|
'user', 'content_type', 'api_token', 'oauth_application',
|
||||||
|
).prefetch_related(
|
||||||
|
'device', 'event'
|
||||||
).order_by('-datetime')
|
).order_by('-datetime')
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user