mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
fix password
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user