File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
piccolo/apps/user/commands Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11import sys
2- from getpass import getpass
2+ from getpass import getpass , getuser
33
44from piccolo .apps .user .tables import BaseUser
55
@@ -8,7 +8,10 @@ def create():
88 """
99 Create a new user.
1010 """
11- username = input ("Enter username:\n " )
11+ default_username = getuser ()
12+ username = input (f"Enter username ({ default_username } ):\n " )
13+ username = default_username if not username else username
14+
1215 email = input ("Enter email:\n " )
1316
1417 password = getpass ("Enter password:\n " )
@@ -18,6 +21,10 @@ def create():
1821 print ("Passwords don't match!" )
1922 sys .exit (1 )
2023
24+ if len (password ) < 4 :
25+ print ("The password is too short" )
26+ sys .exit (1 )
27+
2128 while True :
2229 admin = input ("Admin user? Enter y or n:\n " )
2330 if admin in ("y" , "n" ):
You can’t perform that action at this time.
0 commit comments