From a39ff81e6250fcc6b5bb92c23a94eebac151358b Mon Sep 17 00:00:00 2001 From: Sandro Covo Date: Fri, 30 Apr 2021 16:40:38 +0200 Subject: [PATCH] add example to create user and specify locale Usage of the `attributes`for this kind of task with not quite obvious and documentation hard to find. --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 095782b..63abe49 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,17 @@ new_user = keycloak_admin.create_user({"email": "example@example.com", "enabled": True, "firstName": "Example", "lastName": "Example", - "credentials": [{"value": "secret","type": "password",}]}) + "credentials": [{"value": "secret","type": "password",}]}) + +# Add user and specify a locale +new_user = keycloak_admin.create_user({"email": "example@example.fr", + "username": "example@example.fr", + "enabled": True, + "firstName": "Example", + "lastName": "Example", + "attributes": { + "locale": ["fr"] + }) # User counter count_users = keycloak_admin.users_count()