diff --git a/atst/app.py b/atst/app.py index d1d5d5d6..19d2c901 100644 --- a/atst/app.py +++ b/atst/app.py @@ -9,6 +9,7 @@ from atst.handlers.root import Root from atst.handlers.login_redirect import LoginRedirect from atst.handlers.workspace import Workspace 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_submit import RequestsSubmit from atst.handlers.dev import Dev @@ -92,9 +93,13 @@ def make_app(config, deps, **kwargs): name="requests_submit", ), url( - r"/financial", - Main, - {"page": "financial_verification"}, + r"/requests/verify/(\S+)", + RequestFinancialVerification, + { + "page": "financial_verification", + "requests_client": deps["requests_client"], + "fundz_client": deps["fundz_client"], + }, name="financial_verification", ), url(r"/users", Main, {"page": "users"}, name="users"), diff --git a/atst/handlers/request_financial_verification.py b/atst/handlers/request_financial_verification.py new file mode 100644 index 00000000..51445d66 --- /dev/null +++ b/atst/handlers/request_financial_verification.py @@ -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, + ) + diff --git a/templates/requests.html.to b/templates/requests.html.to index 653c01b3..b56e806f 100644 --- a/templates/requests.html.to +++ b/templates/requests.html.to @@ -29,7 +29,8 @@ {% for r in requests %} - {{ r['order_id'] }} + + {{ r['order_id'] }} {% if r['is_new'] %}New {% end %} diff --git a/templates/financial_verification.html.to b/templates/requests/financial_verification.html.to similarity index 89% rename from templates/financial_verification.html.to rename to templates/requests/financial_verification.html.to index f2ee22b0..06abd2ea 100644 --- a/templates/financial_verification.html.to +++ b/templates/requests/financial_verification.html.to @@ -1,4 +1,4 @@ -{% extends "base.html.to" %} +{% extends "../base.html.to" %} {% block content %}