﻿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
23290	GeometryField validation does not work	lmisek	nobody	"When validating form, (form.is_valid()) 
field '''GeometryField''' failes to validate:
  function to_python(self, value) throws uncatched exception OGRException

django module:
  '''django.contrib.gis.forms.fields'''

source code:
{{{#!python
class GeometryField(forms.Field):
    def to_python(self, value):
        (...)
        try:
            value = GEOSGeometry(value)
        except (GEOSException, ValueError, TypeError):
            raise forms.ValidationError(self.error_messages['invalid_geom'], code='invalid_geom')
        (...)
}}}

'''OGRException''' is raised but not catched, so validation failes.
sample invalid input value:
{{{#!python
str: {""type"": ""Point"", ""coordinates"": [null, 0]}
}}}

should '''OGRException''' be added to '''except''' list?"	Bug	closed	GIS	1.6	Normal	needsinfo	gis validation		Unreviewed	0	0	0	0	1	0
