Merge pull request #424 from dod-ccpo/bugfix-workspace-link
Fix a bug that was crashing the requests index
This commit is contained in:
commit
64f6393678
@ -60,7 +60,7 @@ class RequestsIndex(object):
|
|||||||
def _workspace_link_for_request(self, request):
|
def _workspace_link_for_request(self, request):
|
||||||
if request.is_approved:
|
if request.is_approved:
|
||||||
return url_for(
|
return url_for(
|
||||||
"workspaces.workspace_projects", workspace_id=request.workspace_id
|
"workspaces.workspace_projects", workspace_id=request.workspace.id
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
@ -9,6 +9,8 @@ def test_action_required_mission_owner():
|
|||||||
creator = UserFactory.create()
|
creator = UserFactory.create()
|
||||||
requests = RequestFactory.create_batch(5, creator=creator)
|
requests = RequestFactory.create_batch(5, creator=creator)
|
||||||
Requests.submit(requests[0])
|
Requests.submit(requests[0])
|
||||||
|
Requests.approve_and_create_workspace(requests[1])
|
||||||
|
|
||||||
context = RequestsIndex(creator).execute()
|
context = RequestsIndex(creator).execute()
|
||||||
|
|
||||||
assert context["requests"][0]["action_required"] == False
|
assert context["requests"][0]["action_required"] == False
|
||||||
@ -18,6 +20,7 @@ def test_action_required_ccpo():
|
|||||||
creator = UserFactory.create()
|
creator = UserFactory.create()
|
||||||
requests = RequestFactory.create_batch(5, creator=creator)
|
requests = RequestFactory.create_batch(5, creator=creator)
|
||||||
Requests.submit(requests[0])
|
Requests.submit(requests[0])
|
||||||
|
Requests.approve_and_create_workspace(requests[1])
|
||||||
|
|
||||||
ccpo = UserFactory.from_atat_role("ccpo")
|
ccpo = UserFactory.from_atat_role("ccpo")
|
||||||
context = RequestsIndex(ccpo).execute()
|
context = RequestsIndex(ccpo).execute()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user