Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fountain
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
urz-django
fountain
Commits
b7b75d69
Commit
b7b75d69
authored
Nov 28, 2017
by
Daniel Klaffenbach
🐍
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ldap_createsuperuser: Use input() for asking username
This should improve Python3 compatibility
parent
23a7cb65
Pipeline
#13056
failed with stage
in 11 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
fountain/management/commands/ldap_createsuperuser.py
fountain/management/commands/ldap_createsuperuser.py
+2
-3
No files found.
fountain/management/commands/ldap_createsuperuser.py
View file @
b7b75d69
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
getpass
import
sys
from
django.core.management.base
import
BaseCommand
from
django.contrib.auth
import
get_user_model
...
...
@@ -23,8 +22,7 @@ class Command(BaseCommand):
username
=
options
.
get
(
'username'
)
if
not
username
:
current_user
=
getpass
.
getuser
()
sys
.
stdout
.
write
(
'Username [%s]: '
%
current_user
)
input_user
=
sys
.
stdin
.
readline
().
strip
()
input_user
=
input
(
'Username [{}]: '
.
format
(
current_user
))
if
not
input_user
:
username
=
current_user
else
:
...
...
@@ -46,3 +44,4 @@ class Command(BaseCommand):
else
:
obj
.
save
()
self
.
stdout
.
write
(
"Granted %s privileges to user %s."
%
(
privilege
,
username
))
Daniel Klaffenbach
🐍
@klada--tu-chemnitz.de
mentioned in commit
14e04f41
·
Dec 01, 2017
mentioned in commit
14e04f41
mentioned in commit 14e04f4136ce3ec97735ce3bbb17db155a0cb1ce
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment