Remove rename after creation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 101
- Forks
- 62
- Avg merge
- 15h 15m
- Merged PRs (30d)
- 1
Description
when calling api.content.create omitting the id the parameter, a random id is first created:
https://github.com/plone/plone.api/blob/d2bf66834206cdc58162046b16d1b8d739d6db45/src/plone/api/content.py#L82
Then a new id is computed:
https://github.com/plone/plone.api/blob/d2bf66834206cdc58162046b16d1b8d739d6db45/src/plone/api/content.py#L122
and the object is renamed:
https://github.com/plone/plone.api/blob/d2bf66834206cdc58162046b16d1b8d739d6db45/src/plone/api/content.py#L130
I do not see any reason why the final id is not computed immediately saving the rename operation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/plone/api/content.py at the referenced lines to follow how api.content.create handles a missing id, computes the final id, and renames the object. Confirm the creation path can use the final id directly, then check the surrounding behavior to ensure the rename step is no longer needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100