Skip to content

Commit d5a12f2

Browse files
MikiPWatajsincorporated
authored andcommitted
[FIX]Ruff: lint errors for E731 (langgenius#13018)
1 parent 14a21e5 commit d5a12f2

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

api/.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ignore = [
4545
"E712", # true-false-comparison
4646
"E721", # type-comparison
4747
"E722", # bare-except
48-
"E731", # lambda-assignment
4948
"F821", # undefined-name
5049
"F841", # unused-variable
5150
"FURB113", # repeated-append

api/models/workflow.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,10 @@ def environment_variables(self) -> Sequence[Variable]:
264264

265265
# decrypt secret variables value
266266
def decrypt_func(var):
267-
return (
268-
var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
269-
if isinstance(var, SecretVariable)
270-
else var
271-
)
267+
if isinstance(var, SecretVariable):
268+
return var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
269+
else:
270+
return var
272271

273272
results = list(map(decrypt_func, results))
274273
return results
@@ -294,11 +293,10 @@ def environment_variables(self, value: Sequence[Variable]):
294293

295294
# encrypt secret variables value
296295
def encrypt_func(var):
297-
return (
298-
var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
299-
if isinstance(var, SecretVariable)
300-
else var
301-
)
296+
if isinstance(var, SecretVariable):
297+
return var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
298+
else:
299+
return var
302300

303301
encrypted_vars = list(map(encrypt_func, value))
304302
environment_variables_json = json.dumps(

0 commit comments

Comments
 (0)