Revision 01223f04

b/snf-astakos-app/astakos/im/forms.py
86 86
    r'^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$',
87 87
    re.IGNORECASE)
88 88

  
89
today = datetime.now()
90
today = datetime(today.year, today.month, today.day)
91

  
89 92
class StoreUserMixin(object):
90 93

  
91 94
    def store_user(self, user, request):
......
780 783
    def clean_start_date(self):
781 784
        start_date = self.cleaned_data.get('start_date')
782 785
        if not self.precursor_application:
783
            if start_date and (start_date - datetime.now()).days < -1:
786
            if start_date and (start_date - today).days < 0:
784 787
                raise forms.ValidationError(
785 788
                _(astakos_messages.INVALID_PROJECT_START_DATE))
786 789
        return start_date
......
788 791
    def clean_end_date(self):
789 792
        start_date = self.cleaned_data.get('start_date')
790 793
        end_date = self.cleaned_data.get('end_date')
791
        now = datetime.now()
792
        if end_date and (end_date - now).days < 0:
794
        if end_date and (end_date - today).days < 0:
793 795
            raise forms.ValidationError(
794 796
                _(astakos_messages.INVALID_PROJECT_END_DATE))
795 797
        if start_date and (end_date - start_date).days <= 0:

Also available in: Unified diff