maposmatic-dev
[Top][All Lists]
Advanced

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

[Maposmatic-dev] [PATCH 07/13] Fix maptitle handling in MapRenderingJobF


From: Thomas Petazzoni
Subject: [Maposmatic-dev] [PATCH 07/13] Fix maptitle handling in MapRenderingJobForm
Date: Thu, 5 Aug 2010 16:56:20 +0200

Signed-off-by: Thomas Petazzoni <address@hidden>
---
 www/maposmatic/forms.py |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/www/maposmatic/forms.py b/www/maposmatic/forms.py
index 2039591..def4a1c 100644
--- a/www/maposmatic/forms.py
+++ b/www/maposmatic/forms.py
@@ -105,15 +105,17 @@ class MapRenderingJobForm(forms.ModelForm):
         city = cleaned_data.get("administrative_city")
         title = cleaned_data.get("maptitle")
 
+        if title == '':
+            msg = _(u"Map title required")
+            self._errors["maptitle"] = forms.util.ErrorList([msg])
+            del cleaned_data["maptitle"]
+
         if mode == 'admin':
             if city == "":
                 msg = _(u"Administrative city required")
                 self._errors["administrative_city"] = 
forms.util.ErrorList([msg])
                 del cleaned_data["administrative_city"]
 
-            # No choice, the map title is always the name of the city
-            cleaned_data["maptitle"] = city
-
             # Make sure that bbox and admin modes are exclusive
             cleaned_data["lat_upper_left"] = None
             cleaned_data["lon_upper_left"] = None
@@ -127,11 +129,6 @@ class MapRenderingJobForm(forms.ModelForm):
                 self._errors['administrative_osmid'] = 
forms.util.ErrorList([msg])
 
         elif mode == 'bbox':
-            if title == '':
-                msg = _(u"Map title required")
-                self._errors["maptitle"] = forms.util.ErrorList([msg])
-                del cleaned_data["maptitle"]
-
             for f in [ "lat_upper_left", "lon_upper_left",
                        "lat_bottom_right", "lon_bottom_right" ]:
                 val = cleaned_data.get(f)
-- 
1.7.0.4




reply via email to

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