From f0664e254c88935eb7a6e8956a02bf52e323582b Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Thu, 6 Sep 2018 09:50:45 -0400 Subject: [PATCH] Use `check_workspace_permission` helper --- atst/routes/workspaces.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index 63524ab6..131fcc30 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -70,10 +70,12 @@ def workspace_members(workspace_id): @bp.route("/workspaces//reports") def workspace_reports(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id) - if not Authorization.has_workspace_permission( - g.current_user, workspace, Permissions.VIEW_USAGE_DOLLARS - ): - raise UnauthorizedError(g.current_user, "view workspace reports") + Authorization.check_workspace_permission( + g.current_user, + workspace, + Permissions.VIEW_USAGE_DOLLARS, + "view workspace reports", + ) alternate_reports = http_request.args.get("alternate") month = http_request.args.get("month", 3)