Remove route for /portfolios
This commit is contained in:
parent
9ef4f693eb
commit
74ff581570
@ -3,7 +3,7 @@
|
||||
"files": "^.secrets.baseline$|^.*pgsslrootcert.yml$",
|
||||
"lines": null
|
||||
},
|
||||
"generated_at": "2019-11-26T21:33:43Z",
|
||||
"generated_at": "2019-12-03T19:44:47Z",
|
||||
"plugins_used": [
|
||||
{
|
||||
"base64_limit": 4.5,
|
||||
@ -170,7 +170,7 @@
|
||||
"hashed_secret": "e4f14805dfd1e6af030359090c535e149e6b4207",
|
||||
"is_secret": false,
|
||||
"is_verified": false,
|
||||
"line_number": 657,
|
||||
"line_number": 656,
|
||||
"type": "Hex High Entropy String"
|
||||
}
|
||||
]
|
||||
|
@ -11,16 +11,6 @@ from atst.domain.authz.decorator import user_can_access_decorator as user_can
|
||||
from atst.utils.flash import formatted_flash as flash
|
||||
|
||||
|
||||
@portfolios_bp.route("/portfolios")
|
||||
def portfolios():
|
||||
portfolios = Portfolios.for_user(g.current_user)
|
||||
|
||||
if portfolios:
|
||||
return render_template("portfolios/index.html", page=5, portfolios=portfolios)
|
||||
else:
|
||||
return render_template("portfolios/blank_slate.html")
|
||||
|
||||
|
||||
@portfolios_bp.route("/portfolios/new")
|
||||
def new_portfolio():
|
||||
form = PortfolioCreationForm()
|
||||
|
@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% from "components/empty_state.html" import EmptyState %}
|
||||
{% from "components/tooltip.html" import Tooltip %}
|
||||
|
||||
{% block content %}
|
||||
{{
|
||||
EmptyState(
|
||||
action_href="#",
|
||||
action_label=("portfolios.index.empty.start_button" | translate),
|
||||
icon="cloud",
|
||||
message=("portfolios.index.empty.title" | translate),
|
||||
)
|
||||
}}
|
||||
{% endblock %}
|
@ -65,32 +65,6 @@ def test_create_portfolio_failure(client, user_session):
|
||||
assert len(PortfoliosQuery.get_all()) == original_portfolio_count
|
||||
|
||||
|
||||
def test_portfolio_index_with_existing_portfolios(client, user_session):
|
||||
portfolio = PortfolioFactory.create()
|
||||
user_session(portfolio.owner)
|
||||
|
||||
response = client.get(url_for("portfolios.portfolios"))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert portfolio.name.encode("utf8") in response.data
|
||||
assert (
|
||||
translate("portfolios.index.empty.start_button").encode("utf8")
|
||||
not in response.data
|
||||
)
|
||||
|
||||
|
||||
def test_portfolio_index_without_existing_portfolios(client, user_session):
|
||||
user = UserFactory.create()
|
||||
user_session(user)
|
||||
|
||||
response = client.get(url_for("portfolios.portfolios"))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert (
|
||||
translate("portfolios.index.empty.start_button").encode("utf8") in response.data
|
||||
)
|
||||
|
||||
|
||||
def test_portfolio_reports(client, user_session):
|
||||
portfolio = PortfolioFactory.create(
|
||||
applications=[
|
||||
|
@ -26,7 +26,6 @@ _NO_ACCESS_CHECK_REQUIRED = _NO_LOGIN_REQUIRED + [
|
||||
"portfolios.accept_invitation", # available to all users; access control is built into invitation logic
|
||||
"portfolios.create_portfolio", # create a portfolio
|
||||
"portfolios.new_portfolio", # all users can create a portfolio
|
||||
"portfolios.portfolios", # the portfolios list is scoped to the user separately
|
||||
"task_orders.get_started", # all users can start a new TO
|
||||
"users.update_user", # available to all users
|
||||
"users.user", # available to all users
|
||||
|
@ -105,13 +105,6 @@ def test_protected_routes_redirect_to_login(client, app):
|
||||
assert server_name in resp.headers["Location"]
|
||||
|
||||
|
||||
def test_get_protected_route_encodes_redirect(client):
|
||||
portfolio_index = url_for("portfolios.portfolios")
|
||||
response = client.get(portfolio_index)
|
||||
redirect = url_for("atst.root", next=portfolio_index)
|
||||
assert redirect in response.headers["Location"]
|
||||
|
||||
|
||||
def test_unprotected_routes_set_user_if_logged_in(client, app, user_session):
|
||||
user = UserFactory.create()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user