Remove unused draft validation code
This commit is contained in:
parent
f291450962
commit
f67215d142
@ -30,25 +30,7 @@ def coerce_choice(val):
|
|||||||
return val.value
|
return val.value
|
||||||
|
|
||||||
|
|
||||||
class DraftValidateMixin(object):
|
class TaskOrderForm(ValidatedForm):
|
||||||
def validate_draft(self):
|
|
||||||
return True
|
|
||||||
# """
|
|
||||||
# Make all fields optional before validation, and then return them to
|
|
||||||
# their previous state.
|
|
||||||
# """
|
|
||||||
# for field in self:
|
|
||||||
# field.validators.insert(0, Optional())
|
|
||||||
|
|
||||||
# valid = self.validate()
|
|
||||||
|
|
||||||
# for field in self:
|
|
||||||
# field.validators.pop(0)
|
|
||||||
|
|
||||||
# return valid
|
|
||||||
|
|
||||||
|
|
||||||
class TaskOrderForm(ValidatedForm, DraftValidateMixin):
|
|
||||||
def do_validate_number(self):
|
def do_validate_number(self):
|
||||||
for field in self:
|
for field in self:
|
||||||
if field.name != "task_order-number":
|
if field.name != "task_order-number":
|
||||||
@ -144,7 +126,7 @@ class TaskOrderForm(ValidatedForm, DraftValidateMixin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class RequestFinancialVerificationForm(ValidatedForm, DraftValidateMixin):
|
class RequestFinancialVerificationForm(ValidatedForm):
|
||||||
uii_ids = NewlineListField(
|
uii_ids = NewlineListField(
|
||||||
"Unique Item Identifier (UII)s related to your application(s) if you already have them.",
|
"Unique Item Identifier (UII)s related to your application(s) if you already have them.",
|
||||||
description="If you have more than one UII, place each one on a new line.",
|
description="If you have more than one UII, place each one on a new line.",
|
||||||
@ -224,9 +206,6 @@ class FinancialVerificationForm(ValidatedForm):
|
|||||||
task_order_valid = self.task_order.do_validate_number()
|
task_order_valid = self.task_order.do_validate_number()
|
||||||
return request_valid and task_order_valid
|
return request_valid and task_order_valid
|
||||||
|
|
||||||
def validate_draft(self):
|
|
||||||
return self.task_order.validate_draft() and self.request.validate_draft()
|
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.request.reset()
|
self.request.reset()
|
||||||
|
|
||||||
|
@ -168,9 +168,6 @@ class SaveFinancialVerificationDraft(FinancialVerificationBase):
|
|||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
form = self._get_form(self.request, self.is_extended, self.fv_data)
|
form = self._get_form(self.request, self.is_extended, self.fv_data)
|
||||||
if not form.validate_draft():
|
|
||||||
self._raise(form)
|
|
||||||
|
|
||||||
attachment = self._process_attachment(self.is_extended, form)
|
attachment = self._process_attachment(self.is_extended, form)
|
||||||
task_order = self._try_create_task_order(form, attachment, self.is_extended)
|
task_order = self._try_create_task_order(form, attachment, self.is_extended)
|
||||||
updated_request = Requests.update_financial_verification(
|
updated_request = Requests.update_financial_verification(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user