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
 

	
...
 
@@ -6,9 +8,11 @@ from .models import Assignment
 
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')
 

	
 

	
 
class AssignmentForm(forms.ModelForm):
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -11,8 +11,13 @@
 
    <p>If you have any questions about assigning your copyright to Conservancy, please don't hesitate to email us at <a href="mailto:copyright-assignment@sfconservancy.org">copyright-assignment@sfconservancy.org</a>.</p>
 

	
 
    <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)