﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28105	BaseGeometryWidget.get_context() crashes if attrs contains the name of an existing key	Dylan Verheul	Dylan Verheul	"In`contrib.gis.forms.widgets` there is this part (line 67 in current master):

{{{ 
context = 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
))
}}}

If `attrs` also contains a key 'geom_type' this leads to an inevitable crash.

This should probaly be something like:

{{{
context_kwargs = attrs.copy()
context_kwargs.update(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(),
))
}}}
Currently this causes django-bootstrap3 to fail for Django 1.11."	Bug	closed	GIS	1.11	Release blocker	fixed	gis, forms, widgets		Accepted	0	0	0	0	1	0
