- Adds override to portfolio landing page access check to see if user has access to any applications within the portfolio. - Route for accepting an application invitation redirects directly to portfolio applications route. - Tests ensure application user only sees apps the user has access to on the portfolio landing page.
17 lines
468 B
Python
17 lines
468 B
Python
from flask import redirect, url_for, g
|
|
|
|
from . import applications_bp
|
|
from atst.domain.invitations import ApplicationInvitations
|
|
|
|
|
|
@applications_bp.route("/applications/invitations/<token>", methods=["GET"])
|
|
def accept_invitation(token):
|
|
invite = ApplicationInvitations.accept(g.current_user, token)
|
|
|
|
return redirect(
|
|
url_for(
|
|
"applications.portfolio_applications",
|
|
portfolio_id=invite.application.portfolio_id,
|
|
)
|
|
)
|