Changes between Initial Version and Version 1 of Ticket #28105
- Timestamp:
- 04/21/17 00:12:04 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28105
-
Property
Severity
changed from
Normal
toRelease blocker
-
Property
Triage Stage
changed from
Unreviewed
toAccepted
-
Property
Component
changed from
Forms
toGIS
-
Property
Summary
changed from
Missing check in django.contrib.forms.widgets
toBaseGeometryWidget.get_context() crashes if attrs contains the name of an existing key
-
Property
Severity
changed from
-
Ticket #28105 – Description
initial v1 1 In django.contrib.forms.widgets there is this part (line 67 in corrent master):1 In`contrib.gis.forms.widgets` there is this part (line 67 in current master): 2 2 3 {{{ 3 4 context = self.build_attrs(self.attrs, dict( 4 name=name, 5 module='geodjango_%s' % name.replace('-', '_'), # JS-safe 6 serialized=self.serialize(value), 7 geom_type=gdal.OGRGeomType(self.attrs['geom_type']), 8 STATIC_URL=settings.STATIC_URL, 9 LANGUAGE_BIDI=translation.get_language_bidi(), 10 **attrs 11 )) 5 name=name, 6 module='geodjango_%s' % name.replace('-', '_'), # JS-safe 7 serialized=self.serialize(value), 8 geom_type=gdal.OGRGeomType(self.attrs['geom_type']), 9 STATIC_URL=settings.STATIC_URL, 10 LANGUAGE_BIDI=translation.get_language_bidi(), 11 **attrs 12 )) 13 }}} 12 14 13 15 If `attrs` also contains a key 'geom_type' this leads to an inevitable crash. … … 15 17 This should probaly be something like: 16 18 19 {{{ 17 20 context_kwargs = attrs.copy() 18 context_kwargs.up grade(dict(19 20 21 22 23 24 21 context_kwargs.update(dict( 22 name=name, 23 module='geodjango_%s' % name.replace('-', '_'), # JS-safe 24 serialized=self.serialize(value), 25 geom_type=gdal.OGRGeomType(self.attrs['geom_type']), 26 STATIC_URL=settings.STATIC_URL, 27 LANGUAGE_BIDI=translation.get_language_bidi(), 25 28 )) 26 29 }}} 27 30 Currently this causes django-bootstrap3 to fail for Django 1.11.