fastadmin icon indicating copy to clipboard operation
fastadmin copied to clipboard

automatic hash password during creation record

Open matv864 opened this issue 1 year ago • 4 comments

I've been developing project with your admin panel with fastapi+sqlAlchemy and I can't understand how I can do this in fastAdmin

I see authenticate method and change_password method, but no word about this

In documentation I noticed "password": (WidgetType.PasswordInput, {"passwordModalForm": True}), but when I try to create record, I don't see password field and After sending data, I catch error from sqlAlchemy with NoneType in password field

fieldsets = ( (None, { "fields": ( "role", "firstName", "secondName", "email", "phone", "password" ) }), ) formfield_overrides = { # noqa: RUF012 "role": (WidgetType.Select, {"required": True}), "firstName": (WidgetType.SlugInput, {"required": True}), "secondName": (WidgetType.SlugInput, {"required": True}), "email": (WidgetType.EmailInput, {"required": False}), "phone": (WidgetType.PhoneInput, {"required": True}), "password": (WidgetType.PasswordInput, {"passwordModalForm": True}), }

matv864 avatar Sep 17 '24 04:09 matv864

sorry, I found out I can't read I write exclude password and don't see it

matv864 avatar Sep 17 '24 08:09 matv864

I've been developing project with your admin panel with fastapi+sqlAlchemy and I can't understand how I can do this in fastAdmin

I see authenticate method and change_password method, but no word about this

matv864 avatar Sep 17 '24 08:09 matv864

@matv864 do you still have an issue?

vsdudakov avatar Sep 18 '24 06:09 vsdudakov

@matv864 do you still have an issue?

Yes, Could you add information in documentation about automatic hashing or where "change_password" is used?

matv864 avatar Sep 18 '24 06:09 matv864

@vsdudakov Hi, I have the same issue in fastapi+sqlAlchemy. I defined "change_password" according to the documentation but the UI is not shown in admin UI. I would like to know how and where "change_password" is used.

reouno avatar Oct 15 '24 21:10 reouno

Same, I defined change_password but there is no UI for this

LPJWS avatar Nov 05 '24 08:11 LPJWS

https://github.com/vsdudakov/fastadmin/pull/78/files

vsdudakov avatar Nov 20 '24 20:11 vsdudakov