Auth: add_permission problem ... #452
Answered
by
gi0baro
1st-github-account
asked this question in
Q&A
-
Hi!
It seems that the function does not exist. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
gi0baro
Nov 10, 2022
Replies: 1 comment 1 reply
-
Hi @1st-github-account, this is actually wrong documented. Gonna update the docs ASAP. You can convert your code to: @app.command('setup')
def setup():
with db.connection():
user = User.create(email="lu@localhost", first_name="Lu",last_name="",password="pw")
admins = auth.create_group('admins')
admins.users.add(user)
admins.auth_permissions.create(name="ban_users")
db.commit() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
1st-github-account
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @1st-github-account, this is actually wrong documented. Gonna update the docs ASAP.
You can convert your code to: