[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 1/5] Fix maptitle handling in MapRenderingJobFor
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 1/5] Fix maptitle handling in MapRenderingJobForm |
Date: |
Thu, 5 Aug 2010 09:32:50 +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 e100ec7..ffaaa0f 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
- Re: [Maposmatic-dev] [PATCH 3/6] Add a get_bbox_from_osm_id() helper, (continued)
- [Maposmatic-dev] [PATCH 4/6] Add layout, stylesheet and papersize to MapRenderingForm, Thomas Petazzoni, 2010/08/04
- [Maposmatic-dev] [PATCH 6/6] Implement a brand new wizard for map creation, Thomas Petazzoni, 2010/08/04
- [Maposmatic-dev] [PATCH 5/6] Upgrade jquery to 1.4.2, Thomas Petazzoni, 2010/08/04
- Re: [Maposmatic-dev] [PATCH 1/6] Extend MapRenderingJob with stylesheet, papersize and layout, Maxime Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 4/5] Update licence years, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 2/5] Add link and form to search maps on the front page, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 1/5] Fix maptitle handling in MapRenderingJobForm,
Thomas Petazzoni <=
- [Maposmatic-dev] [PATCH 3/5] Add licence boilerplate in map_rendering_form.css, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 5/5] Fix language selector to work on Chrome, Thomas Petazzoni, 2010/08/05