diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index 34950e45..2bced4d7 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -1,16 +1,26 @@ -from flask import Blueprint, render_template, request as http_request, g, redirect, url_for +from flask import ( + Blueprint, + render_template, + request as http_request, + g, + redirect, + url_for, +) from atst.domain.workspaces import Workspaces, Members, Projects, Environments from atst.forms.new_project import NewProjectForm bp = Blueprint("workspaces", __name__) + @bp.context_processor def workspace(): workspace = None if "workspace_id" in http_request.view_args: - workspace = Workspaces.get(g.current_user, http_request.view_args["workspace_id"]) - return { "workspace": workspace } + workspace = Workspaces.get( + g.current_user, http_request.view_args["workspace_id"] + ) + return {"workspace": workspace} @bp.route("/workspaces") @@ -25,6 +35,11 @@ def workspace_projects(workspace_id): return render_template("workspace_projects.html", workspace=workspace) +@bp.route("/workspaces/") +def show_workspace(workspace_id): + return redirect(url_for("workspaces.workspace_projects", workspace_id=workspace_id)) + + @bp.route("/workspaces//members") def workspace_members(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id)