Changeset - c6b329f0cff0
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 12 months ago 2021-12-07 06:49:57
ben@sturm.com.au
Fix validation.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/forms.py
Show inline comments
...
 
@@ -33,26 +33,26 @@ class AssignmentForm(forms.ModelForm):
 
        validators=[validate_in_past],
 
    )
 
    agreement_terms = forms.CharField(
 
        widget=forms.Textarea(attrs={'readonly': 'readonly'}),
 
        initial=TERMS,
 
        help_text='Please be aware that some employment agreements explicitly transfer copyright ownership to the employer. We recommend you review your recent employment agreements for such clauses.',
 
    )
 

	
 
    class Meta:
 
        model = Assignment
 
        fields = [
 
            'full_name',
 
            'email',
 
            'country_of_residence',
 
            'repositories',
 
            'all_emails',
 
            'period_begins',
 
            'period_end_type',
 
            'period_ends',
 
            'agreement_terms',
 
            'attestation_of_copyright',
 
        ]
 

	
 
    def clean_period_ends(self):
 
        if 'period_begins' in cleaned_data and 'period_ends' in cleaned_data and cleaned_data['period_begins'] > cleaned_data['period_ends']:
 
        if 'period_begins' in self.cleaned_data and 'period_ends' in self.cleaned_data and self.cleaned_data['period_begins'] and self.cleaned_data['period_ends'] and self.cleaned_data['period_begins'] > self.cleaned_data['period_ends']:
 
            raise ValidationError('End of period is before start')
0 comments (0 inline, 0 general)