Development
This commit is contained in:
parent
b4e773c7b2
commit
8aa4373a6b
3 changed files with 52 additions and 5 deletions
|
|
@ -238,13 +238,15 @@ def addedit():
|
|||
flash(f"Username '{username}' is already taken.", 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
conn.close()
|
||||
flash(f"Credential '{username}' updated.", 'success')
|
||||
if password:
|
||||
flash(f'User account "{username}" updated with password "{password}".', 'success')
|
||||
else:
|
||||
flash(f'User account "{username}" updated.', 'success')
|
||||
|
||||
else:
|
||||
if not password:
|
||||
import secrets, string
|
||||
password = ''.join(secrets.choice(string.ascii_lowercase + string.digits) for _ in range(8))
|
||||
flash(f"Auto-generated password for '{username}': {password}", 'success')
|
||||
|
||||
try:
|
||||
hashed = _hash_password(password, digest_type)
|
||||
|
|
@ -267,7 +269,7 @@ def addedit():
|
|||
flash(f"Username '{username}' already exists.", 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
conn.close()
|
||||
flash(f"Credential '{username}' added.", 'success')
|
||||
flash(f'User account "{username}" created with password "{password}".', 'success')
|
||||
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue