#243 Feature without geometry

* fixes GDALException in case of provided feature (import) without geometry content
* modifies 500.html template to inform the user about the admins being informed automatically
pull/244/head
mpeltriaux 2 years ago
parent d6e76f7a2a
commit 5594250d59

@ -82,7 +82,12 @@ class SimpleGeomForm(BaseForm):
"MultiPolygon25D", "MultiPolygon25D",
] ]
for feature in features_json: for feature in features_json:
feature_geom = json.dumps(feature.get("geometry", feature)) feature_geom = feature.get("geometry", feature)
if feature_geom is None:
# Fallback for rare cases where a feature does not contain any geometry
continue
feature_geom = json.dumps(feature_geom)
g = gdal.OGRGeometry(feature_geom, srs=DEFAULT_SRID_RLP) g = gdal.OGRGeometry(feature_geom, srs=DEFAULT_SRID_RLP)
flatten_geometry = g.coord_dim > 2 flatten_geometry = g.coord_dim > 2

Binary file not shown.

@ -2307,8 +2307,8 @@ msgid "Server Error"
msgstr "" msgstr ""
#: templates/500.html:10 #: templates/500.html:10
msgid "Something happened. We are working on it!" msgid "Something happened. Admins have been informed. We are working on it!"
msgstr "Irgendetwas ist passiert. Wir arbeiten daran!" msgstr "Irgendetwas ist passiert. Die Administratoren wurden informiert. Wir arbeiten daran!"
#: templates/email/api/verify_token.html:7 #: templates/email/api/verify_token.html:7
msgid "Hello support" msgid "Hello support"

@ -7,7 +7,7 @@
<h1 class="display-4">{% trans 'Server Error' %}</h1> <h1 class="display-4">{% trans 'Server Error' %}</h1>
<hr> <hr>
<p class="lead"> <p class="lead">
{% trans 'Something happened. We are working on it!' %} {% trans 'Something happened. Admins have been informed. We are working on it!' %}
</p> </p>
</div> </div>
{% endblock %} {% endblock %}
Loading…
Cancel
Save