Commit 14e04f41 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

management: ldap_createsuperuser: Use `six.moves` for `input()` function

Commit b7b75d69 introduced a regression
for Python2 projects where the username input prompt does not work any
more. This can be worked around by using the `input()` function from
parent 09d51d06
Pipeline #13202 passed with stage
in 38 seconds
......@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import getpass
from import BaseCommand
from django.contrib.auth import get_user_model
from django.utils.six import moves
class Command(BaseCommand):
help = "Used to create a superuser without a usable password."
......@@ -22,7 +23,7 @@ class Command(BaseCommand):
username = options.get('username')
if not username:
current_user = getpass.getuser()
input_user = input('Username [{}]: '.format(current_user))
input_user = moves.input('Username [{}]: '.format(current_user))
if not input_user:
username = current_user
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment