Opened 8 years ago
Last modified 8 years ago
#28039 closed Bug
BaseGeometryWidget.subwidgets() crashes with KeyError 'widget' — at Version 4
Reported by: | Dariusz Paluch | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 1.11 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
BaseGeometryWidget.get_context()
doesn't execute super().get_context(self, name, value, attrs)
so key 'widget'
used by method subwidgets()
doesn't exist.
Change History (4)
follow-up: 2 comment:1 by , 8 years ago
comment:2 by , 8 years ago
Replying to Tim Graham:
Can you provide a test case to reproduce the issue?
Just use any BaseGeometryWidget based form field in form.
comment:3 by , 8 years ago
Component: | Forms → GIS |
---|---|
Severity: | Normal → Release blocker |
Summary: | KeyError 'widget' in BaseGeometryWidget → BaseGeometryWidget.subwidgets() crashes with KeyError 'widget' |
Triage Stage: | Unreviewed → Accepted |
Here's a snippet to reproduce:
>>> from django.contrib.gis.forms import OpenLayersWidget >>> widget = forms.OpenLayersWidget() >>> list(widget.subwidgets('name', 'value')) Traceback (most recent call last): ... File "django/django/forms/widgets.py", line 177, in subwidgets yield context['widget'] KeyError: 'widget
comment:4 by , 8 years ago
Description: | modified (diff) |
---|---|
Has patch: | set |
Dariusz, could you your application with this PR. I'm not certain that it's correct.
Note:
See TracTickets
for help on using tickets.
Can you provide a test case to reproduce the issue?