From d60707860ab43db8eb086ae44f0218062385cbe0 Mon Sep 17 00:00:00 2001 From: Vaibhav Mule <vaibhavmule135@gmail.com> Date: Wed, 13 May 2020 17:20:26 +0530 Subject: [PATCH] fix tests for hypha.apply.funds.tests.test_models.TestFormSubmission --- hypha/apply/funds/models/applications.py | 4 ++-- hypha/apply/funds/models/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py index a617a41b5..2e35e1462 100644 --- a/hypha/apply/funds/models/applications.py +++ b/hypha/apply/funds/models/applications.py @@ -356,11 +356,11 @@ class RoundBase(WorkflowStreamForm, SubmittableStreamForm): # type: ignore # Overriding serve method to pass submission id to get_form method copy_open_submission = request.GET.get('open_call_submission') if request.method == 'POST': - draft = bool(request.POST.get('draft')) + draft = request.POST.get('draft', None) form = self.get_form(request.POST, request.FILES, page=self, user=request.user) if form.is_valid(): - form_submission = self.process_form_submission(form, draft) + form_submission = self.process_form_submission(form, draft=draft) return self.render_landing_page(request, form_submission, *args, **kwargs) else: form = self.get_form(page=self, user=request.user, submission_id=copy_open_submission) diff --git a/hypha/apply/funds/models/utils.py b/hypha/apply/funds/models/utils.py index 18aa1e96e..7d7f7e23b 100644 --- a/hypha/apply/funds/models/utils.py +++ b/hypha/apply/funds/models/utils.py @@ -65,7 +65,7 @@ class SubmittableStreamForm(AbstractStreamForm): def get_submission_class(self): return self.submission_class - def process_form_submission(self, form, draft): + def process_form_submission(self, form, draft=False): if not form.user.is_authenticated: form.user = None if draft: -- GitLab