Changeset - 7374c9f91528
[Not reviewed]
0 2 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-12-16 23:54:47
ben@sturm.com.au
assignment: Accept current date anywhere on earth.
2 files changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
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')
 

	
 

	
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -12,6 +12,11 @@
 

	
 
    <form id="assignment-form" action="." method="post" class="mw7">
 
      {% csrf_token %}
 

	
 
      {% if form.errors %}
 
        <p class="dark-red bg-washed-red pa2 ba b--red br1">Please review the errors below.</p>
 
      {% endif %}
 

	
 
      {{ form.as_p }}
 

	
 
      <p><em>Please be aware that your employer or a contractor may own the rights in your work by virtue of their employment of you or by explicit transfer of ownership in an agreement. We recommend you review any relevant agreements or consult with a lawyer if you are not sure.</em></p>
0 comments (0 inline, 0 general)