Skip to content

Commit

Permalink
Merge pull request #118 from ImMin5/master
Browse files Browse the repository at this point in the history
Allow to change parent_group to be root
  • Loading branch information
ImMin5 authored Dec 11, 2023
2 parents 7d930a0 + 83f1d61 commit a492cd4
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/spaceone/identity/service/project_group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,26 @@ def change_parent_group(
ProjectGroupResponse:
"""

# Check parent project group is
self.project_group_mgr.get_project_group(
params.parent_group_id, params.workspace_id, params.domain_id
)

project_group_vo = self.project_group_mgr.get_project_group(
params.project_group_id, params.workspace_id, params.domain_id
)

# Check parent project group is not sub project group
project_group_vos = self.project_group_mgr.filter_project_groups(
workspace_id=params.workspace_id, domain_id=params.domain_id
)
# Check parent project group is
if params.parent_group_id:
self.project_group_mgr.get_project_group(
params.parent_group_id, params.workspace_id, params.domain_id
)

self._check_is_sub_project_group(
params.parent_group_id,
project_group_vo.project_group_id,
project_group_vos,
)
# Check parent project group is not sub project group
project_group_vos = self.project_group_mgr.filter_project_groups(
workspace_id=params.workspace_id, domain_id=params.domain_id
)

self._check_is_sub_project_group(
params.parent_group_id,
project_group_vo.project_group_id,
project_group_vos,
)

project_group_vo = self.project_group_mgr.update_project_group_by_vo(
params.dict(), project_group_vo
Expand Down

0 comments on commit a492cd4

Please sign in to comment.