Skip to content

Commit 395435e

Browse files
committed
re-use lookup
1 parent 1d708c6 commit 395435e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vaultwarden/models/bitwarden.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ def set_key(
223223
handler: ModelWrapValidatorHandler[Self],
224224
info: ValidationInfo,
225225
) -> Self:
226-
if data.get("key") is not None:
226+
if (key := data.get("key")) is not None:
227227
info.context["cctx"].append(
228-
decrypt(data["key"], info.context["cctx"][0])
228+
decrypt(key, info.context["cctx"][0])
229229
)
230230

231231
v = handler(data)
232232

233-
if data.get("key") is not None:
233+
if key is not None:
234234
info.context["cctx"].pop()
235235

236236
return v
@@ -796,7 +796,7 @@ def _get_ciphers(self) -> list[CipherDetails]:
796796
context={
797797
"parent_id": self.Id,
798798
"client": self.api_client,
799-
"cctx": [org_key],
799+
"cctx": [org_key], # crypto context
800800
},
801801
)
802802
return res.Data

0 commit comments

Comments
 (0)