I've built a small api that should be able to add the role to a user:
user = user_datastore.find_user(email=flask.request.args.get('email'))
role = user_datastore.find_role(flask.request.args.get('role'))
result = user_datastore.add_role_to_user(user, role)
(role
& email
are sent through the api). It finds correct user and role objects, the result gives True
but nothing is added to the user's role list which stays []
without any roles.
My setup is similar to/directly based upon the MongoEngine example
It must be something really simple, but I cannot seem to find it :/
BR Carst
May be I am missing something but you need to commit the changes, right ?