Check if form is complete before showing the TO Review page
This commit is contained in:
parent
12776c7124
commit
4d0e5ebb4f
@ -85,12 +85,15 @@ def ko_review(portfolio_id, task_order_id):
|
|||||||
|
|
||||||
Authorization.check_is_ko_or_cor(g.current_user, task_order)
|
Authorization.check_is_ko_or_cor(g.current_user, task_order)
|
||||||
|
|
||||||
return render_template(
|
if TaskOrders.all_sections_complete(task_order):
|
||||||
"/portfolios/task_orders/review.html",
|
return render_template(
|
||||||
portfolio=portfolio,
|
"/portfolios/task_orders/review.html",
|
||||||
task_order=task_order,
|
portfolio=portfolio,
|
||||||
form=KOReviewForm(obj=task_order),
|
task_order=task_order,
|
||||||
)
|
form=KOReviewForm(obj=task_order),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise NotFoundError("task_order")
|
||||||
|
|
||||||
|
|
||||||
@portfolios_bp.route(
|
@portfolios_bp.route(
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="task-order-next-steps__action col">
|
<div class="task-order-next-steps__action col">
|
||||||
{% if not task_order.is_active and button_text and button_url %}
|
{% if not task_order.is_active and complete and button_text and button_url %}
|
||||||
<a
|
<a
|
||||||
href="{{ button_url }}"
|
href="{{ button_url }}"
|
||||||
class="usa-button usa-button-primary">
|
class="usa-button usa-button-primary">
|
||||||
|
@ -308,6 +308,22 @@ def test_ko_can_view_ko_review_page(client, user_session):
|
|||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
|
|
||||||
|
|
||||||
|
def test_cor_cant_view_review_until_to_completed(client, user_session):
|
||||||
|
portfolio = PortfolioFactory.create()
|
||||||
|
user_session(portfolio.owner)
|
||||||
|
task_order = TaskOrderFactory.create(
|
||||||
|
portfolio=portfolio, clin_01=None, cor_dod_id=portfolio.owner.dod_id
|
||||||
|
)
|
||||||
|
response = client.get(
|
||||||
|
url_for(
|
||||||
|
"portfolios.ko_review",
|
||||||
|
portfolio_id=portfolio.id,
|
||||||
|
task_order_id=task_order.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
assert response.status_code == 404
|
||||||
|
|
||||||
|
|
||||||
def test_mo_redirected_to_build_page(client, user_session):
|
def test_mo_redirected_to_build_page(client, user_session):
|
||||||
portfolio = PortfolioFactory.create()
|
portfolio = PortfolioFactory.create()
|
||||||
user_session(portfolio.owner)
|
user_session(portfolio.owner)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user