#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
This commit is contained in:
mpeltriaux 2022-11-22 14:49:51 +01:00
parent d6e76f7a2a
commit 5594250d59
4 changed files with 9 additions and 4 deletions

View File

@ -82,7 +82,12 @@ class SimpleGeomForm(BaseForm):
"MultiPolygon25D",
]
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)
flatten_geometry = g.coord_dim > 2

Binary file not shown.

View File

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

View File

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