From 5a3871154b7bdb4a9e54d51150b144fd1bb2ae7a Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 17 Sep 2018 13:34:14 -0400 Subject: [PATCH] only show edit workspace link to users who have permission, plus formatting --- atst/domain/workspaces/workspaces.py | 5 ++++- atst/forms/workspace.py | 11 ++++++++++- templates/navigation/workspace_navigation.html | 14 ++++++++------ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/atst/domain/workspaces/workspaces.py b/atst/domain/workspaces/workspaces.py index ce05e986..61996955 100644 --- a/atst/domain/workspaces/workspaces.py +++ b/atst/domain/workspaces/workspaces.py @@ -39,7 +39,10 @@ class Workspaces(object): def get_for_update_information(cls, user, workspace_id): workspace = WorkspacesQuery.get(workspace_id) Authorization.check_workspace_permission( - user, workspace, Permissions.EDIT_WORKSPACE_INFORMATION, "update workspace information" + user, + workspace, + Permissions.EDIT_WORKSPACE_INFORMATION, + "update workspace information", ) return workspace diff --git a/atst/forms/workspace.py b/atst/forms/workspace.py index a1248075..76dd6aae 100644 --- a/atst/forms/workspace.py +++ b/atst/forms/workspace.py @@ -5,4 +5,13 @@ from .forms import ValidatedForm class WorkspaceForm(ValidatedForm): - name = StringField("Workspace Name", validators=[Length(min=4, max=50, message="Workspace names must be at least 4 and not more than 50 characters")]) + name = StringField( + "Workspace Name", + validators=[ + Length( + min=4, + max=50, + message="Workspace names must be at least 4 and not more than 50 characters", + ) + ], + ) diff --git a/templates/navigation/workspace_navigation.html b/templates/navigation/workspace_navigation.html index 2b8a18f8..6f311cca 100644 --- a/templates/navigation/workspace_navigation.html +++ b/templates/navigation/workspace_navigation.html @@ -2,12 +2,14 @@