From 419fe7cba33c6e5e6e75a331e6711a8b014acb4d Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 20 Apr 2026 22:14:00 +0200 Subject: [PATCH] Fix GroupConcat --- src/pretix/helpers/database.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pretix/helpers/database.py b/src/pretix/helpers/database.py index 1289f4f1af..d9d8ffb16d 100644 --- a/src/pretix/helpers/database.py +++ b/src/pretix/helpers/database.py @@ -117,12 +117,17 @@ class GroupConcat(Aggregate): template = "%(function)s(%(distinct)s%(field)s::text, '%(separator)s' ORDER BY %(field)s::text ASC)" else: template = "%(function)s(%(distinct)s%(field)s::text, '%(separator)s')" - return super().as_sql( + + template, params = super().as_sql( compiler, connection, function='string_agg', template=template, **extra_context, ) + if self.ordered: + # ordered statement requires field parameters twice + params = params + params + return template, params class ReplicaRouter: