From 186440293d4002cac1e90ad49d26c0e1bfa76879 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 8 Aug 2021 09:50:10 +0200 Subject: [PATCH] user-create avec nom et prenom --- scodoc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scodoc.py b/scodoc.py index ac691a2be2..114783e171 100755 --- a/scodoc.py +++ b/scodoc.py @@ -119,7 +119,9 @@ def _clear_users_db(): @click.argument("username") @click.argument("role") @click.argument("dept") -def user_create(username, role, dept): # user-create +@click.option("-n", "--nom", "nom") +@click.option("-p", "--prenom", "prenom") +def user_create(username, role, dept, nom=None, prenom=None): # user-create "Create a new user" r = Role.get_named_role(role) if not r: @@ -131,7 +133,7 @@ def user_create(username, role, dept): # user-create return 2 if dept == "@all": dept = None - u = User(user_name=username, dept=dept) + u = User(user_name=username, dept=dept, nom=nom, prenom=prenom) u.add_role(r, dept) db.session.add(u) db.session.commit()