diff --git a/atst/forms/financial.py b/atst/forms/financial.py index 52b4ef28..fb66282b 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -36,7 +36,6 @@ def suggest_pe_id(pe_id): return None -@tornado.gen.coroutine def validate_pe_id(field, existing_request, pe_numbers_repo): try: pe_number = pe_numbers_repo.get(field.data) @@ -55,12 +54,11 @@ def validate_pe_id(field, existing_request, pe_numbers_repo): class FinancialForm(ValidatedForm): - @tornado.gen.coroutine def perform_extra_validation(self, existing_request, pe_numbers_repo): valid = True if not existing_request or existing_request.get('pe_id') != self.pe_id.data: valid = yield validate_pe_id(self.pe_id, existing_request, pe_numbers_repo) - raise Return(valid) + return valid task_order_id = StringField( "Task Order Number associated with this request.", validators=[Required()] diff --git a/atst/forms/forms.py b/atst/forms/forms.py index 48f03295..d60e3a2c 100644 --- a/atst/forms/forms.py +++ b/atst/forms/forms.py @@ -5,8 +5,7 @@ from flask_wtf import FlaskForm class ValidatedForm(FlaskForm): - @tornado.gen.coroutine def perform_extra_validation(self, *args, **kwargs): - """A coroutine that performs any applicable extra validation. Must + """Performs any applicable extra validation. Must return True if the form is valid or False otherwise.""" - raise Return(True) + return True diff --git a/atst/routes/requests.py b/atst/routes/requests.py index 565c268e..0c225a7f 100644 --- a/atst/routes/requests.py +++ b/atst/routes/requests.py @@ -63,7 +63,7 @@ def requests_form_update(screen=1, request_id=None): @requests_bp.route("/requests/new//", methods=["POST"]) def requests_update(screen=1, request_id=None): screen = int(screen) - post_data = str(request.data) + post_data = request.form current_user = g.current_user existing_request = Requests.get(request_id) if request_id is not None else None jedi_flow = JEDIRequestFlow( @@ -91,7 +91,7 @@ def requests_update(screen=1, request_id=None): where = "/requests" else: where = url_for( - "requests.requests_Form_update", screen=jedi_flow.next_screen, request_id=jedi_flow.request_id + "requests.requests_form_update", screen=jedi_flow.next_screen, request_id=jedi_flow.request_id ) return redirect(where) else: @@ -120,6 +120,11 @@ def update_financial_verification(): pass +@requests_bp.route("/requests/submit/", methods=["POST"]) +def requests_submit(request_id=None): + pass + + class JEDIRequestFlow(object): def __init__( self, @@ -240,7 +245,7 @@ class JEDIRequestFlow(object): self.form_section: self.form.data } if self.request_id: - Requests.update(request_id, request_data) + Requests.update(self.request_id, request_data) else: request = Requests.create(self.current_user["id"], request_data) self.request_id = request.id diff --git a/templates/requests/screen-3.html b/templates/requests/screen-3.html index af4ea66f..5bdbaf43 100644 --- a/templates/requests/screen-3.html +++ b/templates/requests/screen-3.html @@ -1,18 +1,19 @@ -{% extends '../requests_new.html.to' %} +{% extends 'requests_new.html' %} + +{% from "components.html" import Alert, TextInput %} {% block subtitle %}

Primary Government/Military
Point of Contact (POC)

-{% end %} +{% endblock %} {% block form %} -{% autoescape None %} {% if f.errors %} - {% module Alert('There were some errors', + {{ Alert('There were some errors', message="

Please see below.

", level='error' - ) %} -{% end %} + ) }} +{% endif %}

Please designate a Primary Point of Contact that will be responsible for owning the workspace in the JEDI Cloud.

The Point of Contact will become the primary owner of the workspace created to use the JEDI Cloud. As a workspace owner, this person will have the ability to: @@ -26,9 +27,9 @@ This POC may be you.

-{% module TextInput(f.fname_poc,placeholder='First Name') %} -{% module TextInput(f.lname_poc,placeholder='Last Name') %} -{% module TextInput(f.email_poc,placeholder='jane@mail.mil') %} -{% module TextInput(f.dodid_poc,placeholder='10-digit number on the back of the CAC') %} +{{ TextInput(f.fname_poc,placeholder='First Name') }} +{{ TextInput(f.lname_poc,placeholder='Last Name') }} +{{ TextInput(f.email_poc,placeholder='jane@mail.mil') }} +{{ TextInput(f.dodid_poc,placeholder='10-digit number on the back of the CAC') }} -{% end %} \ No newline at end of file +{% endblock %} diff --git a/templates/requests/screen-4.html b/templates/requests/screen-4.html index 60dd06ac..37cfc5de 100644 --- a/templates/requests/screen-4.html +++ b/templates/requests/screen-4.html @@ -1,27 +1,28 @@ -{% extends '../requests_new.html.to' %} +{% extends 'requests_new.html' %} + +{% from "components.html" import Alert, TextInput %} {% block subtitle %}

Review & Submit

-{% end %} +{% endblock %} {% block form_action %} -
- {% end %} + +{% endblock %} {% block form %} - {% autoescape None %} {% if f.errors %} - {% module Alert('There were some errors', + {{ Alert('There were some errors', message="

Please complete all required fields before submitting.

", level='error' - ) %} - {% end %} + ) }} + {% endif %}

Before you can submit your request, please take a moment to review the information entered in the form. You may make changes by clicking the edit link on each section. When all information looks right, go ahead and submit.

-

Details of Use Edit

+

Details of Use Edit

@@ -107,7 +108,7 @@
-

Information About You Edit

+

Information About You Edit

@@ -152,7 +153,7 @@
-

Primary Point of Contact Edit

+

Primary Point of Contact Edit

@@ -178,15 +179,15 @@ -{% end %} +{% endblock %} {% block next %} {% if not can_submit %} - {% module Alert('There were some errors', + {{ Alert('There were some errors', message="

Please complete all required fields before submitting.

", level='error' - ) %} -{% end %} + ) }} +{% endif %}
@@ -194,4 +195,4 @@ -{% end %} +{% endblock %} diff --git a/templates/requests/screen-5.html b/templates/requests/screen-5.html index e8642f1e..845ed133 100644 --- a/templates/requests/screen-5.html +++ b/templates/requests/screen-5.html @@ -2,13 +2,12 @@ {% block form %} -{% autoescape None %} {% if f.errors %} - {% module Alert('There were some errors', + {{ Alert('There were some errors', message="

Please complete all the fields before submitting.

", level='error' - ) %} -{% end %} + ) }} +{% endif %}

Financial Verification

@@ -20,7 +19,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.uii_ids.label }} {{ f.uii_ids(placeholder="Example: \nDI 0CVA5786950 \nUN1945326361234786950") }} @@ -28,7 +27,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.pe_id.label }} {{ f.pe_id(placeholder="Example: 0203752A") }} @@ -36,7 +35,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.treasury_code.label }} {{ f.treasury_code(placeholder="Example: 1200") }} @@ -44,7 +43,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.ba_code.label }} {{ f.ba_code(placeholder="Example: 02") }} @@ -52,7 +51,7 @@
{{ e }}
-{% end %} +{% endfor %} @@ -64,7 +63,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.lname_co.label }} {{ f.lname_co(placeholder="Contracting Officer last name") }} @@ -72,7 +71,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.email_co.label }} {{ f.email_co(placeholder="jane@mail.mil") }} @@ -80,7 +79,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.office_co.label }} {{ f.office_co(placeholder="Example: WHS") }} @@ -88,7 +87,7 @@
{{ e }}
-{% end %} +{% endfor %} @@ -101,7 +100,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.lname_cor.label }} {{ f.lname_cor(placeholder="Contracting Officer Representative last name") }} @@ -109,7 +108,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.email_cor.label }} {{ f.email_cor(placeholder="jane@mail.mil") }} @@ -117,7 +116,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.office_cor.label }} {{ f.office_cor(placeholder="Example: WHS") }} @@ -125,7 +124,7 @@
{{ e }}
-{% end %} +{% endfor %}

↓ FIELDS NEEDED FOR MANUAL ENTRY OF TASK ORDER INFORMATION (only necessary if EDA info not available) @@ -137,7 +136,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.funding_type_other.label }} {{ f.funding_type_other(placeholder="") }} @@ -145,7 +144,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_0001.label }} {{ f.clin_0001(placeholder="50,000") }} @@ -153,7 +152,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_0003.label }} {{ f.clin_0003(placeholder="13,000") }} @@ -161,7 +160,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_1001.label }} {{ f.clin_1001(placeholder="30,000") }} @@ -169,7 +168,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_1003.label }} {{ f.clin_1003(placeholder="7,000") }} @@ -177,7 +176,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_2001.label }} {{ f.clin_2001(placeholder="30,000") }} @@ -185,7 +184,7 @@
{{ e }}
-{% end %} +{% endfor %} {{ f.clin_2003.label }} {{ f.clin_2003(placeholder="7,000") }} @@ -193,7 +192,7 @@
{{ e }}
-{% end %} +{% endfor %} -{% end %} +{% endblock %}