Show financial verification page when request is approved
This commit is contained in:
parent
e99b13347a
commit
db0db3f327
11
atst/app.py
11
atst/app.py
@ -9,6 +9,7 @@ from atst.handlers.root import Root
|
|||||||
from atst.handlers.login_redirect import LoginRedirect
|
from atst.handlers.login_redirect import LoginRedirect
|
||||||
from atst.handlers.workspace import Workspace
|
from atst.handlers.workspace import Workspace
|
||||||
from atst.handlers.request import Request
|
from atst.handlers.request import Request
|
||||||
|
from atst.handlers.request_financial_verification import RequestFinancialVerification
|
||||||
from atst.handlers.request_new import RequestNew
|
from atst.handlers.request_new import RequestNew
|
||||||
from atst.handlers.request_submit import RequestsSubmit
|
from atst.handlers.request_submit import RequestsSubmit
|
||||||
from atst.handlers.dev import Dev
|
from atst.handlers.dev import Dev
|
||||||
@ -92,9 +93,13 @@ def make_app(config, deps, **kwargs):
|
|||||||
name="requests_submit",
|
name="requests_submit",
|
||||||
),
|
),
|
||||||
url(
|
url(
|
||||||
r"/financial",
|
r"/requests/verify/(\S+)",
|
||||||
Main,
|
RequestFinancialVerification,
|
||||||
{"page": "financial_verification"},
|
{
|
||||||
|
"page": "financial_verification",
|
||||||
|
"requests_client": deps["requests_client"],
|
||||||
|
"fundz_client": deps["fundz_client"],
|
||||||
|
},
|
||||||
name="financial_verification",
|
name="financial_verification",
|
||||||
),
|
),
|
||||||
url(r"/users", Main, {"page": "users"}, name="users"),
|
url(r"/users", Main, {"page": "users"}, name="users"),
|
||||||
|
36
atst/handlers/request_financial_verification.py
Normal file
36
atst/handlers/request_financial_verification.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import tornado
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
|
from atst.handler import BaseHandler
|
||||||
|
from atst.forms.request import RequestForm
|
||||||
|
from atst.forms.org import OrgForm
|
||||||
|
from atst.forms.poc import POCForm
|
||||||
|
from atst.forms.review import ReviewForm
|
||||||
|
from atst.forms.financial import FinancialForm
|
||||||
|
|
||||||
|
|
||||||
|
class RequestFinancialVerification(BaseHandler):
|
||||||
|
def initialize(self, page, requests_client, fundz_client):
|
||||||
|
self.page = page
|
||||||
|
self.requests_client = requests_client
|
||||||
|
self.fundz_client = fundz_client
|
||||||
|
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def get_existing_request(self, request_id):
|
||||||
|
if request_id is None:
|
||||||
|
return {}
|
||||||
|
request = yield self.requests_client.get("/requests/{}".format(request_id))
|
||||||
|
return request.json
|
||||||
|
|
||||||
|
@tornado.web.authenticated
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def get(self, request_id=None):
|
||||||
|
# self.check_xsrf_cookie()
|
||||||
|
# post_data = self.request.arguments
|
||||||
|
current_user = self.get_current_user()
|
||||||
|
existing_request = yield self.get_existing_request(request_id)
|
||||||
|
self.render(
|
||||||
|
"requests/financial_verification.html.to",
|
||||||
|
page=self.page,
|
||||||
|
)
|
||||||
|
|
@ -29,7 +29,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for r in requests %}
|
{% for r in requests %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><a href="{{ reverse_url('request_form_update', 1, r['order_id']) }}">{{ r['order_id'] }}</a>
|
<th scope="row">
|
||||||
|
<a href="{{ reverse_url('request_form_update', 1, r['order_id']) if r["status"] != "approved" else reverse_url('financial_verification', r['order_id']) }}">{{ r['order_id'] }}</a>
|
||||||
{% if r['is_new'] %}<span class="usa-label">New</span>
|
{% if r['is_new'] %}<span class="usa-label">New</span>
|
||||||
</th>
|
</th>
|
||||||
{% end %}
|
{% end %}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.html.to" %}
|
{% extends "../base.html.to" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user