Skip to content

Commit 79248b6

Browse files
author
Matthew Fortunka
committed
fix linting issues
1 parent c1f6b84 commit 79248b6

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

api_app/_version.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
__version__ = "0.22.0"
2-

api_app/api/routes/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
from core import config
1313
from resources import strings
1414

15+
1516
def _is_user_management_enabled():
1617
return config.USER_MANAGEMENT_ENABLED
1718

19+
1820
core_tags_metadata = [
1921
{"name": "health", "description": "Verify that the TRE is up and running"},
2022
{"name": "workspace templates", "description": "**TRE admin** registers and can access templates"},

api_app/api/routes/workspace_users.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
workspaces_users_admin_router = APIRouter(dependencies=[Depends(get_current_admin_user)])
1010
workspaces_users_shared_router = APIRouter(dependencies=[Depends(get_current_workspace_owner_or_researcher_user_or_airlock_manager_or_tre_admin)])
1111

12+
1213
@workspaces_users_shared_router.get("/workspaces/{workspace_id}/users", response_model=UsersInResponse, name=strings.API_GET_WORKSPACE_USERS)
1314
async def get_workspace_users(workspace=Depends(get_workspace_by_id_from_path)) -> UsersInResponse:
1415
access_service = get_access_service()
1516
users = access_service.get_workspace_users(workspace)
1617
return UsersInResponse(users=users)
1718

19+
1820
@workspaces_users_admin_router.get("/workspaces/{workspace_id}/assignable-users", response_model=AssignableUsersInResponse, name=strings.API_GET_ASSIGNABLE_USERS)
1921
async def get_assignable_users(workspace=Depends(get_workspace_by_id_from_path)) -> AssignableUsersInResponse:
2022
access_service = get_access_service()
@@ -28,6 +30,7 @@ async def get_workspace_roles(workspace=Depends(get_workspace_by_id_from_path))
2830
roles = access_service.get_workspace_roles(workspace)
2931
return RolesInResponse(roles=roles)
3032

33+
3134
@workspaces_users_admin_router.post("/workspaces/{workspace_id}/users/assign", status_code=status.HTTP_202_ACCEPTED, name=strings.API_ASSIGN_WORKSPACE_USER)
3235
async def assign_workspace_user(response: Response, user_email: str, role_name: str, workspace=Depends(get_workspace_by_id_from_path)) -> UsersInResponse:
3336
access_service = get_access_service()
@@ -38,12 +41,13 @@ async def assign_workspace_user(response: Response, user_email: str, role_name:
3841
access_service.assign_workspace_user(
3942
user,
4043
workspace,
41-
role,
44+
role
4245
)
4346

4447
users = access_service.get_workspace_users(workspace)
4548
return UsersInResponse(users=users)
4649

50+
4751
@workspaces_users_admin_router.delete("/workspaces/{workspace_id}/users/assign",
4852
status_code=status.HTTP_202_ACCEPTED,
4953
name=strings.API_REMOVE_WORKSPACE_USER_ASSIGNMENT)

api_app/api/routes/workspaces.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
user_resources_workspace_router = APIRouter(dependencies=[Depends(get_current_workspace_owner_or_researcher_user_or_airlock_manager)])
4444

4545

46-
4746
def validate_user_has_valid_role_for_user_resource(user, user_resource):
4847
if "WorkspaceOwner" in user.roles:
4948
return
@@ -186,6 +185,7 @@ async def invoke_action_on_workspace(response: Response, action: str, user=Depen
186185

187186
return OperationInResponse(operation=operation)
188187

188+
189189
# workspace operations
190190
# This method only returns templates that the authenticated user is authorized to use
191191
@workspaces_shared_router.get("/workspaces/{workspace_id}/workspace-service-templates", response_model=ResourceTemplateInformationInList, name=strings.API_GET_WORKSPACE_SERVICE_TEMPLATES_IN_WORKSPACE)
@@ -534,5 +534,3 @@ async def retrieve_user_resource_operations_by_user_resource_id_and_operation_id
534534
async def retrieve_user_resource_history_by_user_resource_id(user_resource=Depends(get_user_resource_by_id_from_path), user=Depends(get_current_workspace_owner_or_researcher_user_or_airlock_manager), resource_history_repo=Depends(get_repository(ResourceHistoryRepository))) -> ResourceHistoryInList:
535535
validate_user_has_valid_role_for_user_resource(user, user_resource)
536536
return ResourceHistoryInList(resource_history=await resource_history_repo.get_resource_history_by_resource_id(resource_id=user_resource.id))
537-
538-

0 commit comments

Comments
 (0)