mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 08:38:58 +08:00
[FIX]Ruff: lint errors for E731 (#13018)
This commit is contained in:
parent
561a3bf7a0
commit
2e467cbc74
@ -45,7 +45,6 @@ ignore = [
|
|||||||
"E712", # true-false-comparison
|
"E712", # true-false-comparison
|
||||||
"E721", # type-comparison
|
"E721", # type-comparison
|
||||||
"E722", # bare-except
|
"E722", # bare-except
|
||||||
"E731", # lambda-assignment
|
|
||||||
"F821", # undefined-name
|
"F821", # undefined-name
|
||||||
"F841", # unused-variable
|
"F841", # unused-variable
|
||||||
"FURB113", # repeated-append
|
"FURB113", # repeated-append
|
||||||
|
@ -256,11 +256,10 @@ class Workflow(Base):
|
|||||||
|
|
||||||
# decrypt secret variables value
|
# decrypt secret variables value
|
||||||
def decrypt_func(var):
|
def decrypt_func(var):
|
||||||
return (
|
if isinstance(var, SecretVariable):
|
||||||
var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
|
return var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
|
||||||
if isinstance(var, SecretVariable)
|
else:
|
||||||
else var
|
return var
|
||||||
)
|
|
||||||
|
|
||||||
results = list(map(decrypt_func, results))
|
results = list(map(decrypt_func, results))
|
||||||
return results
|
return results
|
||||||
@ -286,11 +285,10 @@ class Workflow(Base):
|
|||||||
|
|
||||||
# encrypt secret variables value
|
# encrypt secret variables value
|
||||||
def encrypt_func(var):
|
def encrypt_func(var):
|
||||||
return (
|
if isinstance(var, SecretVariable):
|
||||||
var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
|
return var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
|
||||||
if isinstance(var, SecretVariable)
|
else:
|
||||||
else var
|
return var
|
||||||
)
|
|
||||||
|
|
||||||
encrypted_vars = list(map(encrypt_func, value))
|
encrypted_vars = list(map(encrypt_func, value))
|
||||||
environment_variables_json = json.dumps(
|
environment_variables_json = json.dumps(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user