* fixes bug where empty geometry would have lead to exception during is_valid check on SimpleGeomForm
This commit is contained in:
mpeltriaux 2022-05-27 15:01:43 +02:00
parent 4f482595c6
commit 59c5072619

View File

@ -311,6 +311,9 @@ class SimpleGeomForm(BaseForm):
# Get geojson from form
geom = self.data["geom"]
if geom is None or len(geom) == 0:
# empty geometry is a valid geometry
return is_valid
geom = json.loads(geom)
# Write submitted data back into form field to make sure invalid geometry