﻿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	Missing check in django.contrib.forms.widgets	Dylan Verheul	nobody	"In django.contrib.forms.widgets there is this part (line 67 in corrent 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.upgrade(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	new	Forms	1.11	Normal		gis, forms, widgets		Unreviewed	0	0	0	0	0	0
