maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH 1/2] Bug fix: Check that we have floats before c


From: David MENTRE
Subject: [Maposmatic-dev] [PATCH 1/2] Bug fix: Check that we have floats before computing BoudingBox
Date: Sat, 21 Apr 2012 18:08:54 +0200

Signed-off-by: David MENTRE <address@hidden>
---
 www/maposmatic/views.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/www/maposmatic/views.py b/www/maposmatic/views.py
index eea2580..9c4cae6 100644
--- a/www/maposmatic/views.py
+++ b/www/maposmatic/views.py
@@ -243,6 +243,12 @@ def query_papersize(request):
                 lon_upper_left = f.cleaned_data.get("lon_upper_left")
                 lat_bottom_right = f.cleaned_data.get("lat_bottom_right")
                 lon_bottom_right = f.cleaned_data.get("lon_bottom_right")
+
+                # Check we have correct floats
+                if (lat_upper_left == None or lon_upper_left == None
+                    or lat_bottom_right == None or lon_bottom_right == None):
+                   return HttpResponseBadRequest("ERROR: Invalid arguments")
+
                 bbox = coords.BoundingBox(lat_upper_left, lon_upper_left,
                                           lat_bottom_right, lon_bottom_right)
 
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]