#36246: Malformed GeoJSON throws server error
------------------------------+--------------------------------------
Reporter: David Buhler | Type: Bug
Status: new | Component: GIS
Version: 4.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
When passing malformed GeoJSON, either using incorrect GeoJSON values or
simply malformed JSON, a GDALException is raised:
https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/gdal/prototypes/errcheck.py#L75
This differs from the GEOSException that is thrown when passing in WKT:
https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/geos/prototypes/errcheck.py#L32
The GEOSException is handled during form deserialization, but not the
GDALException, during widget deserialization:
https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/forms/widgets.py#L54
This seems to be handled properly during field deserialization:
https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/forms/fields.py#L46
This remains an issue with the 5.2.x. branch.
--
Ticket URL: <https://code.djangoproject.com/ticket/36246>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019587307a89-9288cf2a-7f40-4a3a-ad49-17dd5836ef08-000000%40eu-central-1.amazonses.com.