Merge pull request #705 from dod-ccpo/so-redirect

Have officer invite url point to the TO view page
This commit is contained in:
leigh-mil
2019-03-15 10:36:57 -04:00
committed by GitHub
3 changed files with 83 additions and 9 deletions

View File

@@ -221,6 +221,14 @@ class TaskOrder(Base, mixins.TimestampsMixin):
"""
return self.so_invite and not self.security_officer
@property
def officers(self):
return [
self.contracting_officer,
self.contracting_officer_representative,
self.security_officer,
]
_OFFICER_PREFIXES = {
"contracting_officer": "ko",
"contracting_officer_representative": "cor",

View File

@@ -26,7 +26,7 @@ def accept_invitation(token):
# - the logged-in user has multiple roles on the TO (e.g., KO and COR)
# - the logged-in user has officer roles on multiple unsigned TOs
for task_order in invite.portfolio.task_orders:
if g.current_user == task_order.contracting_officer:
if g.current_user in task_order.officers:
return redirect(
url_for(
"portfolios.view_task_order",
@@ -34,14 +34,6 @@ def accept_invitation(token):
task_order_id=task_order.id,
)
)
elif g.current_user == task_order.contracting_officer_representative:
return redirect(
url_for("task_orders.new", screen=4, task_order_id=task_order.id)
)
elif g.current_user == task_order.security_officer:
return redirect(
url_for("task_orders.new", screen=4, task_order_id=task_order.id)
)
return redirect(
url_for("portfolios.show_portfolio", portfolio_id=invite.portfolio.id)