forked from CGM_Public/pretix_original
Add more log entry types to the org-level logs page (#5787)
* Add more log entry types to the org-level logs page all_logentries() limits the QuerySet to LogEntrys whose content object is an Organizer. This change expands that to get any LogEntry linked to the current Organization. It removes those that are linked directly to an Event, since they are already served by the event-level logs page. * Check active plugins with either Event or Organizer
This commit is contained in:
@@ -141,8 +141,9 @@ class LogEntry(models.Model):
|
||||
|
||||
log_entry_type, meta = log_entry_types.get(action_type=self.action_type)
|
||||
if log_entry_type:
|
||||
sender = self.event if self.event else self.organizer
|
||||
link_info = log_entry_type.get_object_link_info(self)
|
||||
if is_app_active(self.event, meta['plugin']):
|
||||
if is_app_active(sender, meta['plugin']):
|
||||
return make_link(link_info, log_entry_type.object_link_wrapper)
|
||||
else:
|
||||
return make_link(link_info, log_entry_type.object_link_wrapper, is_active=False,
|
||||
|
||||
@@ -2583,7 +2583,7 @@ class LogView(OrganizerPermissionRequiredMixin, PaginationMixin, ListView):
|
||||
def get_queryset(self):
|
||||
# technically, we'd also need to sort by pk since this is a paginated list, but in this case we just can't
|
||||
# bear the performance cost
|
||||
qs = self.request.organizer.all_logentries().select_related(
|
||||
qs = self.request.organizer.logentry_set.filter(event=None).select_related(
|
||||
'user', 'content_type', 'api_token', 'oauth_application', 'device'
|
||||
).order_by('-datetime')
|
||||
qs = qs.exclude(action_type__in=OVERVIEW_BANLIST)
|
||||
|
||||
Reference in New Issue
Block a user