Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rename after creation #421

Open
ale-rt opened this issue Nov 13, 2018 · 1 comment
Open

Remove rename after creation #421

ale-rt opened this issue Nov 13, 2018 · 1 comment

Comments

@ale-rt
Copy link
Member

ale-rt commented Nov 13, 2018

when calling api.content.create omitting the id the parameter, a random id is first created:

content_id = not safe_id and id or str(random.randint(0, 99999999))

Then a new id is computed:
new_id = chooser.chooseName(derived_id, content)

and the object is renamed:
content.aq_parent.manage_renameObject(content_id, new_id)

I do not see any reason why the final id is not computed immediately saving the rename operation

@ale-rt
Copy link
Member Author

ale-rt commented Nov 13, 2018

Well we need the content object to actually compute the new_id. Checking anyway if this can be improved.

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

No branches or pull requests

1 participant