Opened 7 years ago

Last modified 7 years ago

#28105 closed Bug

Missing check in django.contrib.forms.widgets — at Initial Version

Reported by: Dylan Verheul Owned by: nobody
Component: GIS Version: 1.11
Severity: Release blocker Keywords: gis, forms, widgets
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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.attrsgeom_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.attrsgeom_type),
STATIC_URL=settings.STATIC_URL,
LANGUAGE_BIDI=translation.get_language_bidi(),

))

Currently this causes django-bootstrap3 to fail for Django 1.11.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top