Changeset - c9a76ea17fe3
[Not reviewed]
0 2 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-12-10 23:25:57
ben@sturm.com.au
assignment: Fix period ends in email.
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/forms.py
Show inline comments
...
 
@@ -62,6 +62,8 @@ class AssignmentForm(forms.ModelForm):
 
    def clean_period_ends(self):
 
        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')
 

	
 
        if self.cleaned_data['period_end_type'] == 'a specific past date' and not self.cleaned_data['period_ends']:
 
            raise ValidationError('This field is required')
 

	
 
        return self.cleaned_data['period_ends']
www/conservancy/apps/assignment/views.py
Show inline comments
...
 
@@ -19,13 +19,13 @@ class AssignmentCreateView(CreateView):
 
            'Copyright assignment form: {}'.format(form.cleaned_data['full_name']),
 
            body,
 
            'ben@sturm.com.au',
 
            ['denver@sfconservancy.org', 'bsturmfels@sfconservancy.org'],
 
        )
 
        return super().form_valid(form)
 
    
 

 
    def get_success_url(self, *args, **kwargs):
 
        return reverse_lazy('assignment-thanks', kwargs={'pk': str(self.object.uuid)})
 

	
 

	
 
class AssignmentThanksView(DetailView):
 
    model = Assignment
0 comments (0 inline, 0 general)