From cc3c29db21eb0132d3911162ec871aca2d2bbeaa Mon Sep 17 00:00:00 2001 From: long2ice Date: Wed, 29 Jul 2020 16:02:35 +0800 Subject: [PATCH] fix password --- fastapi_admin/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi_admin/common.py b/fastapi_admin/common.py index f3f9e1d..2b63bc2 100644 --- a/fastapi_admin/common.py +++ b/fastapi_admin/common.py @@ -24,8 +24,8 @@ async def handle_m2m_fields_create_or_update( for k, v in body.items(): if k in m2m_fields: m2m_body[k] = copy_body.pop(k) - password = copy_body.pop("password", None) if model == user_model and not create: + password = copy_body.get("password") user = await user_model.get(pk=pk) if user.password != password: copy_body["password"] = pwd_context.hash(password)