2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-01-28 09:03:41 +00:00

feat(backend): enable reseting mfa via username from the cli (#11133)

* feat(backend): enable reseting mfa via username

* fix tests

* extend testing saveguards to username cli
This commit is contained in:
Matthias Mair
2026-01-14 12:04:21 +01:00
committed by GitHub
parent 9c1b03eb71
commit 07e1a72261
3 changed files with 81 additions and 40 deletions

View File

@@ -619,14 +619,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(