diff options
Diffstat (limited to 'taskapp/forms/task.py')
-rw-r--r-- | taskapp/forms/task.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/taskapp/forms/task.py b/taskapp/forms/task.py index f3655bf..9f8cc98 100644 --- a/taskapp/forms/task.py +++ b/taskapp/forms/task.py @@ -12,7 +12,7 @@ def AddMentorForm(choices,instance=None): class myform(forms.Form): mentor = forms.ChoiceField(choices=choices, required=True) - form = myform(instance=instance) if instance else myform() + form = myform(instance) if instance else myform() return form class ClaimTaskForm(forms.ModelForm): @@ -20,12 +20,12 @@ class ClaimTaskForm(forms.ModelForm): model = Claim fields = ['message'] -def ChoiceForm(choices): +def ChoiceForm(choices, instance=None): """ return a form object with appropriate choices """ class myform(forms.Form): choice = forms.ChoiceField(choices=choices, required=True) - form = myform() + form = myform(instance) if instance else myform() return form def AddTaskForm(task_choices, is_plain=False): |