Skip to content

Commit

Permalink
Added Validation Error in _validate_within_boundaries method lines 41-47
Browse files Browse the repository at this point in the history
  • Loading branch information
ertush committed Oct 22, 2024
1 parent f5da0a9 commit 685eba6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mfl_gis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def _validate_within_boundaries(self, boundary_model, area, raise_not_found=True
try:
boundary = boundary_model.objects.get(area=area)
if not boundary.mpoly.contains(self.coordinates):
# raise ValidationError({
# "coordinates": [
# '({0}, {1}) not contained in boundary of {2}'.format(
# self.coordinates.x, self.coordinates.y, area
# )
# ]
# })
pass
raise ValidationError({
"coordinates": [
'({0}, {1}) not contained in boundary of {2}'.format(
self.coordinates.x, self.coordinates.y, area
)
]
})
# pass'
else:
return True
except boundary_model.DoesNotExist:
Expand Down

0 comments on commit 685eba6

Please sign in to comment.