Devices: Fix bulk edit query (#3541)

This commit is contained in:
Raphael Michel
2023-08-23 11:20:26 +02:00
committed by GitHub
parent 1c9219609a
commit b56bd8541e
2 changed files with 16 additions and 8 deletions

View File

@@ -1054,8 +1054,8 @@ class DeviceBulkUpdateView(DeviceQueryMixin, OrganizerDetailViewMixin, Organizer
limit_events_list=Subquery(
Device.limit_events.through.objects.filter(
device_id=OuterRef('pk')
).order_by('device_id', 'event_id').values('device_id').annotate(
g=GroupConcat('event_id', separator=',')
).order_by().values('device_id').annotate(
g=GroupConcat('event_id', separator=',', ordered=True)
).values('g')
)
)