Skip to content

Extract generate_user_id/generate_login_name as standalone functions#147

Merged
mauritsvanrees merged 5 commits intomasterfrom
plip-4292-fix-user-creation
Mar 20, 2026
Merged

Extract generate_user_id/generate_login_name as standalone functions#147
mauritsvanrees merged 5 commits intomasterfrom
plip-4292-fix-user-creation

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented Mar 17, 2026

Part of PLIP 4292.

  • Extract generate_user_id() and generate_login_name() from BaseRegistrationForm into standalone functions in plone.app.users.utils
  • Form methods now delegate to the standalone functions
  • Enables reuse from plone.api and plone.restapi without form view dependency
  • 1:1 logic extraction, no behavioral changes

Depends on: nothing
Depended on by: plone/plone.api#603 plone/plone.restapi#1993

Move user ID and login name generation logic from
BaseRegistrationForm methods into standalone functions in
plone.app.users.utils, enabling reuse from plone.api and
plone.restapi without form view dependency.

Part of PLIP 4292.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mister-roboto
Copy link
Copy Markdown

@jensens thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 17, 2026

Red b/c of old meta.toml, #148 will fix it

@jensens jensens requested a review from mauritsvanrees March 17, 2026 15:09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 17, 2026

@jenkins-plone-org please run jobs

Copy link
Copy Markdown
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One inline comment about a deprecation notice we should add.

Comment thread src/plone/app/users/browser/register.py Outdated
Comment thread news/4292.feature Outdated
jensens and others added 2 commits March 20, 2026 00:43
Co-authored-by: David Glick <david@glicksoftware.com>
Mark the backwards-compat re-export with a deprecation warning so it
can be removed in Plone 7. Consumers should import from
plone.app.users.utils instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jensens jensens force-pushed the plip-4292-fix-user-creation branch from e0f8f03 to 76fb2d7 Compare March 19, 2026 23:54
@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 19, 2026

@jenkins-plone-org please run jobs

@jensens jensens requested a review from mauritsvanrees March 20, 2026 00:00
@mauritsvanrees mauritsvanrees merged commit dee1624 into master Mar 20, 2026
11 checks passed
@mauritsvanrees mauritsvanrees deleted the plip-4292-fix-user-creation branch March 20, 2026 15:42
@mauritsvanrees
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants