Add support for injecting additional data when creating user

This commit is contained in:
Michal Čihař 2020-09-02 11:37:23 +02:00
parent 160e7bfa71
commit 3be167144a

View file

@ -35,7 +35,8 @@ TEMPLATE = """{
"rt_pass": "", "rt_pass": "",
"rt_start": 1, "rt_start": 1,
"rt_end": 1000, "rt_end": 1000,
"usermap": {} "usermap": {},
"userdata": {}
} }
""" """
@ -165,6 +166,7 @@ def get_user(userdata, attr="login"):
# Create new one # Create new one
if lemail not in USERMAP: if lemail not in USERMAP:
kwargs = {"email": email} kwargs = {"email": email}
kwargs.update(config["userdata"])
if "RealName" in userdata: if "RealName" in userdata:
realname = userdata["RealName"] realname = userdata["RealName"]
if ", " in realname: if ", " in realname: