mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-04-21 06:13:45 +00:00
add "silent" flag to openwebrx-admin
This commit is contained in:
parent
e548d6a5de
commit
d99669b3aa
3 changed files with 30 additions and 10 deletions
|
|
@ -27,6 +27,10 @@ class UserCommand(Command, metaclass=ABCMeta):
|
|||
class NewUser(UserCommand):
|
||||
def run(self, args):
|
||||
username = self.getUser(args)
|
||||
userList = UserList()
|
||||
# early test to bypass the password stuff if the user already exists
|
||||
if username in userList:
|
||||
raise KeyError("User {username} already exists".format(username=username))
|
||||
|
||||
if args.noninteractive:
|
||||
print("Generating password for user {username}...".format(username=username))
|
||||
|
|
@ -43,7 +47,6 @@ class NewUser(UserCommand):
|
|||
sys.exit(1)
|
||||
|
||||
print("Creating user {username}...".format(username=username))
|
||||
userList = UserList()
|
||||
user = User(name=username, enabled=True, password=DefaultPasswordClass(password))
|
||||
userList.addUser(user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue