diff options
| author | Taoup <mahongtao0x7e0@163.com> | 2020-02-18 15:20:55 +0800 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-18 10:32:23 +0100 |
| commit | cbb6531e5bef7ffe0c46d6c44d598d7bcdf9029e (patch) | |
| tree | 4b5eacde845a3d4114f700a19b29e5801db15ad5 /django/db | |
| parent | f37d548ede290690589e86b892c4f106e2a8e1bc (diff) | |
Fixed #31228 -- Reallowed aggregates to be used with multiple expressions and no DISTINCT on SQLite.
Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111.
Thanks Andy Terra for the report.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/sqlite3/operations.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py index 83ee1489a6..80c32f6fcd 100644 --- a/django/db/backends/sqlite3/operations.py +++ b/django/db/backends/sqlite3/operations.py @@ -56,7 +56,11 @@ class DatabaseOperations(BaseDatabaseOperations): 'aggregations on date/time fields in sqlite3 ' 'since date/time is saved as text.' ) - if isinstance(expression, models.Aggregate) and len(expression.source_expressions) > 1: + if ( + isinstance(expression, models.Aggregate) and + expression.distinct and + len(expression.source_expressions) > 1 + ): raise NotSupportedError( "SQLite doesn't support DISTINCT on aggregate functions " "accepting multiple arguments." |
