Daniel Holbach has proposed merging lp:~dholbach/loco-directory/582571 into 
lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)
Related bugs:
  #582571 Formatting issue on Venue page
  https://bugs.launchpad.net/bugs/582571

-- 
https://code.launchpad.net/~dholbach/loco-directory/582571/+merge/29554
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~dholbach/loco-directory/582571 into lp:loco-directory.
=== modified file 'loco_directory/locale/loco-directory.pot'
--- loco_directory/locale/loco-directory.pot	2010-07-01 06:26:23 +0000
+++ loco_directory/locale/loco-directory.pot	2010-07-09 14:05:57 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-07-01 06:21+0000\n"
+"POT-Creation-Date: 2010-07-09 14:04+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <em...@address>\n"
 "Language-Team: LANGUAGE <[email protected]>\n"
@@ -22,7 +22,7 @@
 
 #: events/forms.py:128 teams/forms.py:22 templates/events/event_list.html:18
 #: templates/teams/team_list.html:17 templates/venues/venue_list.html:15
-#: venues/forms.py:20
+#: venues/forms.py:27
 msgid "Search"
 msgstr ""
 
@@ -1049,6 +1049,10 @@
 msgid "Select venue position"
 msgstr ""
 
+#: venues/forms.py:9
+msgid "Please use a descriptive name for the venue."
+msgstr ""
+
 #: venues/models.py:17
 msgid "Name of the Venue"
 msgstr ""

=== modified file 'loco_directory/venues/forms.py'
--- loco_directory/venues/forms.py	2010-01-11 08:51:45 +0000
+++ loco_directory/venues/forms.py	2010-07-09 14:05:57 +0000
@@ -4,7 +4,10 @@
 from django.utils.translation import ugettext_lazy as _
 from models import Venue
 
-
+def validate_name(name):
+    if not name.strip():
+        raise forms.ValidationError(_(u'Please use a descriptive name for the venue.'))
+    return name
 
 class VenueForm(forms.ModelForm):
     """ 
@@ -13,6 +16,10 @@
     class Meta:
         model = Venue
 
+    def clean(self):
+        self.cleaned_data['name'] = validate_name(self.cleaned_data['name'])
+        return self.cleaned_data
+
 class VenueSearchForm(forms.Form):
     """
     A Search form for venues

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to