Avoid locking users out of a map with an invalid crop

pull/1664/head
Piero Toffanin 2025-05-06 00:05:42 -04:00
rodzic b344dbcbf8
commit 44020ee9ec
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -211,6 +211,13 @@ class Metadata(TaskNestedView):
info = json.loads(metadata.json())
except IndexError as e:
# Caught when trying to get an invalid raster metadata
# or when the crop area is defined improperly. In order
# to avoid locking the user out of the map, we remove cropping
# if this ever happens.
if task.crop is not None:
task.crop = None
task.save()
raise exceptions.ValidationError("Cannot retrieve raster metadata: %s" % str(e))
# Override min/max
if hrange: