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

Make cli "roles create" idempotent #297

Open
fenekku opened this issue Feb 7, 2020 · 0 comments
Open

Make cli "roles create" idempotent #297

fenekku opened this issue Feb 7, 2020 · 0 comments
Assignees

Comments

@fenekku
Copy link
Contributor

fenekku commented Feb 7, 2020

invenio roles create <your role name> fails if re-run, but the goal of the cli command is just to have a '' role entry in the DB. Checking for existence and only creating if not there, would not break compatibility and make usage of the command much smoother. This just means using flask_security.datastore.UserDataStore.find_or_create_role instead. (I will probably send a PR)

This request stems from invenio roles create admin being used in instance setup where the goal is to get to a state rather than execute a particular action.

@fenekku fenekku self-assigned this Feb 10, 2020
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

No branches or pull requests

1 participant