mirror of
https://github.com/inventree/InvenTree.git
synced 2026-03-11 14:44:18 +00:00
* feat(backend): enable reseting mfa via username
* fix tests
* extend testing saveguards to username cli
(cherry picked from commit 07e1a72261)
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
committed by
GitHub
parent
9970b0f5c7
commit
bd2d6036bf
15
tasks.py
15
tasks.py
@@ -592,14 +592,19 @@ def clean_settings(c):
|
||||
success('Settings cleaned successfully')
|
||||
|
||||
|
||||
@task(help={'mail': "mail of the user who's MFA should be disabled"})
|
||||
def remove_mfa(c, mail=''):
|
||||
@task(
|
||||
help={
|
||||
'mail': "mail of the user who's MFA should be disabled",
|
||||
'username': "username of the user who's MFA should be disabled",
|
||||
}
|
||||
)
|
||||
def remove_mfa(c, mail='', username=''):
|
||||
"""Remove MFA for a user."""
|
||||
if not mail:
|
||||
warning('You must provide a users mail')
|
||||
if not mail and not username:
|
||||
warning('You must provide a users mail or username')
|
||||
return
|
||||
|
||||
manage(c, f'remove_mfa {mail}')
|
||||
manage(c, f'remove_mfa --mail {mail} --username {username}')
|
||||
|
||||
|
||||
@task(
|
||||
|
||||
Reference in New Issue
Block a user