[open-ils-commits] r960 - servres/trunk/conifer/syrup/views (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 16 18:56:31 EDT 2010
Author: gfawcett
Date: 2010-08-16 18:56:30 -0400 (Mon, 16 Aug 2010)
New Revision: 960
Modified:
servres/trunk/conifer/syrup/views/sites.py
Log:
handle term-sequencing error in form validation, not just in the model.
Modified: servres/trunk/conifer/syrup/views/sites.py
===================================================================
--- servres/trunk/conifer/syrup/views/sites.py 2010-08-14 14:40:54 UTC (rev 959)
+++ servres/trunk/conifer/syrup/views/sites.py 2010-08-16 22:56:30 UTC (rev 960)
@@ -9,6 +9,13 @@
model = models.Site
exclude = ('access',)
+ def clean_end_term(self):
+ cd = self.cleaned_data
+ if cd['start_term'].start > cd['end_term'].start:
+ raise ValidationError(
+ 'The end-term precedes the start-term.')
+ return cd['end_term']
+
def __init__(self, *args, **kwargs):
owner = self.base_fields['owner']
owner.label_from_instance = lambda u: '%s (%s)' % (
More information about the open-ils-commits
mailing list