From 509d9da26fb92a8d566ec105ff40bb024803ceaa Mon Sep 17 00:00:00 2001 From: Étienne Beaulé Date: Mon, 19 Oct 2020 17:10:06 -0400 Subject: Fixed #26390 -- Disabled grouping by Random(). Thanks to Tzu-ping Chung for the tests. --- django/db/models/functions/math.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django') diff --git a/django/db/models/functions/math.py b/django/db/models/functions/math.py index 304e112225..15915f4b7c 100644 --- a/django/db/models/functions/math.py +++ b/django/db/models/functions/math.py @@ -154,6 +154,9 @@ class Random(NumericOutputFieldMixin, Func): def as_sqlite(self, compiler, connection, **extra_context): return super().as_sql(compiler, connection, function='RAND', **extra_context) + def get_group_by_cols(self, alias=None): + return [] + class Round(Transform): function = 'ROUND' -- cgit v1.3