Skip to content

Commit

Permalink
Merge pull request #160 from whdalsrnt/master
Browse files Browse the repository at this point in the history
fix: fix service util bug
  • Loading branch information
whdalsrnt authored Dec 26, 2024
2 parents 130c58f + 17751f2 commit c5a978c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/spaceone/core/service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def change_value_by_rule(rule: str, param_key: str, value: any = None) -> any:
def wrapper(func: callable) -> callable:
@functools.wraps(func)
def wrapped_func(cls, params: dict) -> Union[dict, types.GeneratorType]:
if param_value := params.get(param_key):
if param_key in params:
param_value = params[param_key]
if rule == "APPEND":
if isinstance(param_value, list):
param_value.append(value)
Expand Down Expand Up @@ -287,7 +288,7 @@ def wrapped_func(cls, params):


def change_timestamp_value(
timestamp_keys=None, timestamp_format="google_timestamp"
timestamp_keys=None, timestamp_format="google_timestamp"
) -> callable:
if timestamp_keys is None:
timestamp_keys = []
Expand Down Expand Up @@ -339,7 +340,7 @@ def wrapped_func(cls, params):


def change_timestamp_filter(
filter_keys=None, timestamp_format="google_timestamp"
filter_keys=None, timestamp_format="google_timestamp"
) -> callable:
if filter_keys is None:
filter_keys = []
Expand Down Expand Up @@ -377,7 +378,7 @@ def _is_null(value) -> bool:


def _change_timestamp_condition(
query_filter, filter_keys, filter_type, timestamp_format
query_filter, filter_keys, filter_type, timestamp_format
) -> list:
change_filter = []

Expand Down

0 comments on commit c5a978c

Please sign in to comment.