diff options
| author | Dylan Verheul <dylan@zostera.nl> | 2017-04-29 15:35:46 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-04-30 20:19:12 -0400 |
| commit | 75aeebebfe3df3ea46b8e12dd5e7719f98664d3a (patch) | |
| tree | 4a70867e318909b82b182d89ed851a8b7036b3d0 /django/contrib/gis/forms | |
| parent | 1ebd295082bb0e6b230cf3bc39fd04bee71c2bd7 (diff) | |
Fixed #28105 -- Fixed crash in BaseGeometryWidget.get_context() when overriding existing attrs.
Diffstat (limited to 'django/contrib/gis/forms')
| -rw-r--r-- | django/contrib/gis/forms/widgets.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/django/contrib/gis/forms/widgets.py b/django/contrib/gis/forms/widgets.py index 82d9f26b1c..df5cd9b3f0 100644 --- a/django/contrib/gis/forms/widgets.py +++ b/django/contrib/gis/forms/widgets.py @@ -63,15 +63,16 @@ class BaseGeometryWidget(Widget): if attrs is None: attrs = {} - context.update(self.build_attrs(self.attrs, dict( - name=name, - module='geodjango_%s' % name.replace('-', '_'), # JS-safe - serialized=self.serialize(value), - geom_type=gdal.OGRGeomType(self.attrs['geom_type']), - STATIC_URL=settings.STATIC_URL, - LANGUAGE_BIDI=translation.get_language_bidi(), - **attrs - ))) + build_attrs_kwargs = { + 'name': name, + 'module': 'geodjango_%s' % name.replace('-', '_'), # JS-safe + 'serialized': self.serialize(value), + 'geom_type': gdal.OGRGeomType(self.attrs['geom_type']), + 'STATIC_URL': settings.STATIC_URL, + 'LANGUAGE_BIDI': translation.get_language_bidi(), + } + build_attrs_kwargs.update(attrs) + context.update(self.build_attrs(self.attrs, build_attrs_kwargs)) return context |
