Skip to content

Commit 27ec8a7

Browse files
authored
Merge pull request #1664 from pierotofy/cons
Avoid locking users out of a map with an invalid crop
2 parents 52a0511 + 44020ee commit 27ec8a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/api/tiler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ def get(self, request, pk=None, project_pk=None, tile_type=""):
211211
info = json.loads(metadata.json())
212212
except IndexError as e:
213213
# Caught when trying to get an invalid raster metadata
214+
# or when the crop area is defined improperly. In order
215+
# to avoid locking the user out of the map, we remove cropping
216+
# if this ever happens.
217+
if task.crop is not None:
218+
task.crop = None
219+
task.save()
220+
214221
raise exceptions.ValidationError("Cannot retrieve raster metadata: %s" % str(e))
215222
# Override min/max
216223
if hrange:

0 commit comments

Comments
 (0)