2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-03-11 14:44:18 +00:00

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

* 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:
github-actions[bot]
2026-01-14 22:11:35 +11:00
committed by GitHub
parent 9970b0f5c7
commit bd2d6036bf
3 changed files with 81 additions and 40 deletions

View File

@@ -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(