Fixed start_date end_date reversed check for periods
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 28 Nov 2010 12:21:55 +0000 (12:21 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 28 Nov 2010 12:21:55 +0000 (12:21 +0000)
bin/djais/views.py

index f18fe0bb1e4db22b9ae18c36742a2af47a772da8..3a8ab79e962719b589c6f669e4be2a1c64790e4f 100644 (file)
@@ -206,7 +206,7 @@ class HistoryForm(forms.Form):
         #if period_type in (u'date_date',) and end_date is None:
         #    self._errors["end_date"] = self.error_class(['That field is required.'])
         if period_type == u'date_date' and start_date is not None and end_date is not None:
         #if period_type in (u'date_date',) and end_date is None:
         #    self._errors["end_date"] = self.error_class(['That field is required.'])
         if period_type == u'date_date' and start_date is not None and end_date is not None:
-            if start_date <= end_date:
+            if start_date >= end_date:
                 self._errors["start_date"] = self.error_class(['Start date must be before end date.'])
         return cleaned_data
 
                 self._errors["start_date"] = self.error_class(['Start date must be before end date.'])
         return cleaned_data