Added optional argument '--email' for createopenslidesuser command.
This commit is contained in:
parent
7a26a87cf8
commit
b3c98dd207
@ -16,12 +16,14 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument("username", help="The username of the new user.")
|
parser.add_argument("username", help="The username of the new user.")
|
||||||
parser.add_argument("password", help="The password of the new user.")
|
parser.add_argument("password", help="The password of the new user.")
|
||||||
parser.add_argument("groups_id", help="The group id of the new user.")
|
parser.add_argument("groups_id", help="The group id of the new user.")
|
||||||
|
parser.add_argument("--email", help="The email address of the new user.")
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
user_data = {
|
user_data = {
|
||||||
"first_name": options["first_name"],
|
"first_name": options["first_name"],
|
||||||
"last_name": options["last_name"],
|
"last_name": options["last_name"],
|
||||||
"default_password": options["password"],
|
"default_password": options["password"],
|
||||||
|
"email": options["email"] or "",
|
||||||
}
|
}
|
||||||
user = User.objects.create_user(
|
user = User.objects.create_user(
|
||||||
options["username"], options["password"], skip_autoupdate=True, **user_data
|
options["username"], options["password"], skip_autoupdate=True, **user_data
|
||||||
|
Loading…
Reference in New Issue
Block a user