forked from ScoDoc/DocScoDoc
user-create avec nom et prenom
This commit is contained in:
parent
cc1967b315
commit
186440293d
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user