[Debconf-video-commits] r398 - package/branches/pycon09/src/pyconvideo/pyconvideo

benh at alioth.debian.org benh at alioth.debian.org
Thu Mar 26 21:19:28 UTC 2009


Author: benh
Date: 2009-03-26 21:19:28 +0000 (Thu, 26 Mar 2009)
New Revision: 398

Modified:
   package/branches/pycon09/src/pyconvideo/pyconvideo/views.py
Log:
Add validation of start_time < end_time.


Modified: package/branches/pycon09/src/pyconvideo/pyconvideo/views.py
===================================================================
--- package/branches/pycon09/src/pyconvideo/pyconvideo/views.py	2009-03-26 19:40:16 UTC (rev 397)
+++ package/branches/pycon09/src/pyconvideo/pyconvideo/views.py	2009-03-26 21:19:28 UTC (rev 398)
@@ -54,6 +54,11 @@
     end_time = IntervalField()
     base_name = forms.CharField()
     comments = forms.CharField(required=False, widget=forms.Textarea)
+    def clean(self):
+        if not (self.cleaned_data['start_time'] <
+                self.cleaned_data['end_time']):
+            raise forms.ValidationError('End time must be later than start time')
+        return self.cleaned_data
 
 @login_required
 @transaction.commit_on_success




More information about the Debconf-video-commits mailing list