Editing task should not change its completed status

This commit is contained in:
Scot Hacker 2019-09-18 23:18:01 -07:00
parent 2d40ef471e
commit 4f9f379543
5 changed files with 47 additions and 8 deletions

View file

@ -49,6 +49,8 @@ class AddEditTaskForm(ModelForm):
note = forms.CharField(widget=forms.Textarea(), required=False)
completed = forms.BooleanField(required=False)
def clean_created_by(self):
"""Keep the existing created_by regardless of anything coming from the submitted form.
If creating a new task, then created_by will be None, but we set it before saving."""