[Top][All Lists]
[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
- [Maposmatic-dev] [PATCH 01/13] Extend MapRenderingJob with stylesheet, papersize and layout, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 03/13] Add a get_bbox_from_osm_id() helper, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 11/13] Fix language selector to work on Chrome, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 07/13] Fix maptitle handling in MapRenderingJobForm,
Thomas Petazzoni <=
- [Maposmatic-dev] [PATCH 04/13] Add layout, stylesheet and papersize to MapRenderingForm, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 13/13] Improve the slippy map notifier usage to show when the area is too big, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 12/13] Move Ajax service to the /apis/ directory, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 10/13] Update licence years, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 02/13] Implement a skeleton /papersize/ service, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 06/13] Implement a brand new wizard for map creation, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 08/13] Add link and form to search maps on the front page, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 09/13] Add licence boilerplate in map_rendering_form.css, Thomas Petazzoni, 2010/08/05
- [Maposmatic-dev] [PATCH 05/13] Upgrade jquery to 1.4.2, Thomas Petazzoni, 2010/08/05