Fix hash_password twice

This commit is contained in:
long2ice
2021-05-20 13:59:41 +08:00
parent 266c6ba65b
commit eb119a564e

View File

@@ -138,11 +138,11 @@ class UsernamePasswordProvider(Provider):
async def create_user(self, username: str, password: str):
return await self.admin_model.create(
username=username,
password=hash_password(password),
password=password,
)
async def update_password(self, admin: AbstractAdmin, password: str):
admin.password = hash_password(password)
admin.password = password
await admin.save(update_fields=["password"])
async def init_view(self, request: Request):