only if powershell
This commit is contained in:
parent
91f2708a87
commit
9a7c90b194
|
@ -339,7 +339,7 @@ def replace_db_values(
|
|||
# check if attr exists and isn't a function
|
||||
if hasattr(obj, temp[1]) and not callable(getattr(obj, temp[1])):
|
||||
temp1 = getattr(obj, temp[1])
|
||||
if isinstance(temp1, str) and "'" in temp1:
|
||||
if shell == ScriptShell.POWERSHELL and isinstance(temp1, str) and "'" in temp1:
|
||||
temp1 = temp1.replace("'", "''")
|
||||
|
||||
value = f"'{temp1}'" if quotes else temp1
|
||||
|
@ -372,7 +372,11 @@ def replace_db_values(
|
|||
elif value is not None and field.type == CustomFieldType.CHECKBOX:
|
||||
value = format_shell_bool(value, shell)
|
||||
else:
|
||||
if isinstance(value, str) and "'" in value:
|
||||
if (
|
||||
shell == ScriptShell.POWERSHELL
|
||||
and isinstance(value, str)
|
||||
and "'" in value
|
||||
):
|
||||
value = value.replace("'", "''")
|
||||
|
||||
value = f"'{value}'" if quotes else value
|
||||
|
|
Loading…
Reference in New Issue