[FIX]Ruff: lint errors for E731 (#13018)

This commit is contained in:
Miki Watanabe 2025-03-05 16:54:04 +09:00 committed by GitHub
parent 561a3bf7a0
commit 2e467cbc74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View File

@ -45,7 +45,6 @@ ignore = [
"E712", # true-false-comparison
"E721", # type-comparison
"E722", # bare-except
"E731", # lambda-assignment
"F821", # undefined-name
"F841", # unused-variable
"FURB113", # repeated-append

View File

@ -256,11 +256,10 @@ class Workflow(Base):
# decrypt secret variables value
def decrypt_func(var):
return (
var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
if isinstance(var, SecretVariable)
else var
)
if isinstance(var, SecretVariable):
return var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
else:
return var
results = list(map(decrypt_func, results))
return results
@ -286,11 +285,10 @@ class Workflow(Base):
# encrypt secret variables value
def encrypt_func(var):
return (
var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
if isinstance(var, SecretVariable)
else var
)
if isinstance(var, SecretVariable):
return var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
else:
return var
encrypted_vars = list(map(encrypt_func, value))
environment_variables_json = json.dumps(