plone / plone.api

The Plone API
https://6.docs.plone.org/plone.api
Other
86 stars 53 forks source link

Userid is not in UUID when set site to use UUID for userid. #492

Open fongtech opened 2 years ago

fongtech commented 2 years ago

While testing Plone6 with plone.api-2.0.0b1, with site set as "Use email address as login name" and "Use UUID user ids".

api.user.create(email='the@email.com', password='password', properties={'fullname':'fullname'}) The new user will get the email as the userid, it should create a unique UUID as userid.

Ankuristic commented 8 months ago

so , i understand the probem and i also think that we can resolve this using : user_id = str(uuid.uuid4()) but when i contribute why alsways it make my contribution close . i also sign the plone contributing agreement . so help me as a new controbutor on plone how i start.

davisagli commented 8 months ago

@Ankuristic There is a setting "Use UUID user ids". A UUID should only be set as the user id if this setting is turned on; otherwise we have to keep the user id that was specified by the user.

davisagli commented 8 months ago

plone.api should use the same logic as the registration form in the classic UI for generating user ids: https://github.com/plone/plone.app.users/blob/master/plone/app/users/browser/register.py