From 61b3289ac1ab8db30153fbb73753b0c49eb7df23 Mon Sep 17 00:00:00 2001 From: Vaibhav Mule <vaibhavmule135@gmail.com> Date: Mon, 18 May 2020 17:38:51 +0530 Subject: [PATCH] add minor changes --- hypha/apply/funds/models/applications.py | 4 ++-- hypha/apply/funds/models/submissions.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py index 968b49c12..b3d5ca429 100644 --- a/hypha/apply/funds/models/applications.py +++ b/hypha/apply/funds/models/applications.py @@ -357,7 +357,7 @@ 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 = request.POST.get('draft', None) + draft = request.POST.get('draft', False) form = self.get_form(request.POST, request.FILES, page=self, user=request.user) if form.is_valid(): @@ -446,7 +446,7 @@ class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm): # type: ig def serve(self, request, *args, **kwargs): if request.method == 'POST': form = self.get_form(request.POST, request.FILES, page=self, user=request.user) - draft = request.POST.get('draft', None) + draft = request.POST.get('draft', False) if form.is_valid(): form_submission = SubmittableStreamForm.process_form_submission(self, form, draft=draft) return self.render_landing_page(request, form_submission, *args, **kwargs) diff --git a/hypha/apply/funds/models/submissions.py b/hypha/apply/funds/models/submissions.py index f8804ac6b..ad8876357 100644 --- a/hypha/apply/funds/models/submissions.py +++ b/hypha/apply/funds/models/submissions.py @@ -45,6 +45,7 @@ from ..blocks import NAMED_BLOCKS, ApplicationCustomFormFieldsBlock from ..workflow import ( COMMUNITY_REVIEW_PHASES, DETERMINATION_RESPONSE_PHASES, + DRAFT, INITIAL_STATE, PHASES, PHASES_MAPPING, @@ -161,7 +162,7 @@ class ApplicationSubmissionQueryset(JSONOrderable): ) def exclude_draft(self): - return self.exclude(status='draft') + return self.exclude(status=DRAFT) def with_latest_update(self): activities = self.model.activities.rel.model -- GitLab