Changeset 1299:fb540c42162b
- Timestamp:
- 01/11/10 22:18:43 (2 years ago)
- Branch:
- default
- rebase_source:
- 2e55f41bb43c44448dd345aaa05ba1b65160d816
- Location:
- zine
- Files:
-
- 2 edited
-
forms.py (modified) (2 diffs)
-
utils/forms.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zine/forms.py
r1284 r1299 109 109 )]) 110 110 body = forms.TextField(lazy_gettext(u'Text'), min_length=2, max_length=6000, 111 messages=dict(111 required=True, messages=dict( 112 112 too_short=lazy_gettext(u'Your comment is too short.'), 113 113 too_long=lazy_gettext(u'Your comment is too long.'), … … 140 140 if not self.post.comments_enabled: 141 141 raise ValidationError(_('Post is closed for commenting.')) 142 elif self.post.comments_closed:142 if self.post.comments_closed: 143 143 raise ValidationError(_('Commenting is no longer possible.')) 144 144 -
zine/utils/forms.py
r1287 r1299 1250 1250 def convert(self, value): 1251 1251 value = _to_string(value) 1252 if self.required: 1253 if not value: 1254 raise ValidationError(self.messages['required']) 1255 elif value: 1252 if self.required and not value: 1253 raise ValidationError(self.messages['required']) 1254 if value: 1256 1255 if self.min_length is not None and len(value) < self.min_length: 1257 1256 message = self.messages['too_short']
Note: See TracChangeset
for help on using the changeset viewer.