TaskOrders gets EDA client from current Flask app

This commit is contained in:
dandds
2018-08-21 14:02:01 -04:00
parent a50b855389
commit 1a9606f2b8
5 changed files with 21 additions and 20 deletions

View File

@@ -119,15 +119,9 @@ class BaseFinancialForm(ValidatedForm):
class FinancialForm(BaseFinancialForm):
def __init__(self, *args, **kwargs):
self.eda_client = kwargs.get("eda_client")
if self.eda_client:
del(kwargs["eda_client"])
super().__init__(*args, **kwargs)
def validate_task_order_number(form, field):
try:
TaskOrders.get(field.data, client=form.eda_client)
TaskOrders.get(field.data)
except NotFoundError:
raise ValidationError("Task Order number not found")