Skip to content

Commit

Permalink
feat: modify logic of options expressions when using add method
Browse files Browse the repository at this point in the history
Signed-off-by: seolmin <[email protected]>
  • Loading branch information
stat-kwon committed Nov 5, 2024
1 parent b200b83 commit 37986c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/spaceone/dashboard/service/private_data_table_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def add_data_table(self, params_dict: dict) -> dict:
user_id,
)

raw_filter = copy.deepcopy(options.get("filter"))

if source_type == "COST":
if plugin_id := options.get("COST", {}).get("plugin_id"):
data_source_id = self._get_data_source_id_from_plugin_id(plugin_id)
Expand Down Expand Up @@ -106,6 +108,9 @@ def add_data_table(self, params_dict: dict) -> dict:
params_dict["state"] = ds_mgr.state
params_dict["error_message"] = ds_mgr.error_message

if raw_filter:
params_dict["options"]["filter"] = raw_filter

pri_data_table_vo = self.pri_data_table_mgr.create_private_data_table(
params_dict
)
Expand Down
5 changes: 5 additions & 0 deletions src/spaceone/dashboard/service/public_data_table_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def add_data_table(self, params_dict: dict) -> dict:
user_projects,
)

raw_filter = copy.deepcopy(options.get("filter"))

if source_type == "COST":
if plugin_id := options.get("COST", {}).get("plugin_id"):
data_source_id = self._get_data_source_id_from_plugin_id(plugin_id)
Expand Down Expand Up @@ -110,6 +112,9 @@ def add_data_table(self, params_dict: dict) -> dict:
params_dict["state"] = ds_mgr.state
params_dict["error_message"] = ds_mgr.error_message

if raw_filter:
params_dict["options"]["filter"] = raw_filter

pub_data_table_vo = self.pub_data_table_mgr.create_public_data_table(
params_dict
)
Expand Down

0 comments on commit 37986c0

Please sign in to comment.