Skip to content

Commit

Permalink
Rename worksheets internal method
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Nov 14, 2024
1 parent 1a2782e commit 1ae1b72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/dataall/modules/worksheets/services/worksheet_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class WorksheetService:
@staticmethod
def get_worksheet_by_uri(session, uri: str) -> Worksheet:
def _get_worksheet_by_uri(session, uri: str) -> Worksheet:
if not uri:
raise exceptions.RequiredParameter(param_name='worksheetUri')
worksheet = WorksheetRepository.find_worksheet_by_uri(session, uri)
Expand Down Expand Up @@ -74,7 +74,7 @@ def create_worksheet(data=None) -> Worksheet:
def update_worksheet(uri, data=None):
context = get_context()
with context.db_engine.scoped_session() as session:
worksheet = WorksheetService.get_worksheet_by_uri(session, uri)
worksheet = WorksheetService._get_worksheet_by_uri(session, uri)
for field in data.keys():
setattr(worksheet, field, data.get(field))
session.commit()
Expand All @@ -94,7 +94,7 @@ def update_worksheet(uri, data=None):
@ResourcePolicyService.has_resource_permission(GET_WORKSHEET)
def get_worksheet(uri):
with get_context().db_engine.scoped_session() as session:
worksheet = WorksheetService.get_worksheet_by_uri(session, uri)
worksheet = WorksheetService._get_worksheet_by_uri(session, uri)
return worksheet

@staticmethod
Expand All @@ -115,7 +115,7 @@ def list_user_worksheets(filter):
@ResourcePolicyService.has_resource_permission(DELETE_WORKSHEET)
def delete_worksheet(uri) -> bool:
with get_context().db_engine.scoped_session() as session:
worksheet = WorksheetService.get_worksheet_by_uri(session, uri)
worksheet = WorksheetService._get_worksheet_by_uri(session, uri)
session.delete(worksheet)
ResourcePolicyService.delete_resource_policy(
session=session,
Expand All @@ -130,7 +130,7 @@ def delete_worksheet(uri) -> bool:
def run_sql_query(uri, worksheetUri, sqlQuery):
with get_context().db_engine.scoped_session() as session:
environment = EnvironmentService.get_environment_by_uri(session, uri)
worksheet = WorksheetService.get_worksheet_by_uri(session, worksheetUri)
worksheet = WorksheetService._get_worksheet_by_uri(session, worksheetUri)

env_group = EnvironmentService.get_environment_group(
session, worksheet.SamlAdminGroupName, environment.environmentUri
Expand Down

0 comments on commit 1ae1b72

Please sign in to comment.