Pass in current user when fetching task order
This commit is contained in:
parent
175d0df234
commit
43757d5d3b
@ -1,4 +1,4 @@
|
|||||||
from flask import redirect, url_for
|
from flask import g, redirect, url_for
|
||||||
|
|
||||||
from . import task_orders_bp
|
from . import task_orders_bp
|
||||||
from atst.domain.task_orders import TaskOrders
|
from atst.domain.task_orders import TaskOrders
|
||||||
@ -8,7 +8,7 @@ from atst.utils.flash import formatted_flash as flash
|
|||||||
# TODO: add a real implementation for this
|
# TODO: add a real implementation for this
|
||||||
@task_orders_bp.route("/task_orders/invite/<task_order_id>", methods=["POST"])
|
@task_orders_bp.route("/task_orders/invite/<task_order_id>", methods=["POST"])
|
||||||
def invite(task_order_id):
|
def invite(task_order_id):
|
||||||
task_order = TaskOrders.get(task_order_id)
|
task_order = TaskOrders.get(g.current_user, task_order_id)
|
||||||
flash("task_order_submitted", task_order=task_order)
|
flash("task_order_submitted", task_order=task_order)
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for("workspaces.workspace_members", workspace_id=task_order.workspace.id)
|
url_for("workspaces.workspace_members", workspace_id=task_order.workspace.id)
|
||||||
|
@ -14,7 +14,7 @@ def workspace_task_orders(workspace_id):
|
|||||||
@workspaces_bp.route("/workspaces/<workspace_id>/task_order/<task_order_id>")
|
@workspaces_bp.route("/workspaces/<workspace_id>/task_order/<task_order_id>")
|
||||||
def view_task_order(workspace_id, task_order_id):
|
def view_task_order(workspace_id, task_order_id):
|
||||||
workspace = Workspaces.get(g.current_user, workspace_id)
|
workspace = Workspaces.get(g.current_user, workspace_id)
|
||||||
task_order = TaskOrders.get(task_order_id)
|
task_order = TaskOrders.get(g.current_user, task_order_id)
|
||||||
return render_template(
|
return render_template(
|
||||||
"workspaces/task_orders/show.html", workspace=workspace, task_order=task_order
|
"workspaces/task_orders/show.html", workspace=workspace, task_order=task_order
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user