File diff 6e380dba29b3 → 7374c9f91528
www/conservancy/apps/assignment/forms.py
Show inline comments
 
import datetime
 

	
 
from django import forms
 
from django.core.validators import ValidationError
 
from django.utils import timezone
...
 
@@ -7,7 +9,9 @@ from .terms import TERMS
 

	
 

	
 
def validate_in_past(value):
 
    if value > timezone.now().date():
 
    # Adding a day to allow the current date anywhere on earth, regardless of
 
    # the server timezone.
 
    if value > timezone.now().date() + datetime.timedelta(days=1):
 
        raise ValidationError('Enter a date in the past')