diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-03-23 23:27:13 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-23 19:09:04 -0400 |
| commit | e9149d3eb0ed0ddc8b27b1990eb2b7293c1231cd (patch) | |
| tree | 36bdda886a26c319d6eadc0cc8f168d3d430f646 /django | |
| parent | 7e09fa7f519daf2f9c26587c3da5dc044d84b032 (diff) | |
Fixed #27603 -- Fixed AsKML when queryset is evaluated more than once.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/db/models/functions.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/gis/db/models/functions.py b/django/contrib/gis/db/models/functions.py index 01b2c93446..b688299cb5 100644 --- a/django/contrib/gis/db/models/functions.py +++ b/django/contrib/gis/db/models/functions.py @@ -195,8 +195,9 @@ class AsGML(GeoFunc): class AsKML(AsGML): def as_sqlite(self, compiler, connection): # No version parameter - self.source_expressions.pop(0) - return super().as_sql(compiler, connection) + clone = self.copy() + clone.set_source_expressions(self.get_source_expressions()[1:]) + return clone.as_sql(compiler, connection) class AsSVG(GeoFunc): |
