Update add_user.py

This commit is contained in:
Saifeddine ALOUI 2024-01-16 11:49:38 +01:00 committed by GitHub
parent 2c76aa166f
commit d1fcd4e97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ def add_user(users_list=None):
"""Add a new user to the users list file"""
user_name = input('Enter your username: ')
key = generate_key()
print(f'Your key is: {key}')
print(f'Your key is: {user_name}:{key}')
if not users_list or not users_list.exists():
users_list = Path(users_list) if users_list else Path('authorized_users.txt')
users_list.touch(exist_ok=True)