Coverage for gws-app/gws/plugin/account/cli.py: 0%
15 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-05 13:35 +0200
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-05 13:35 +0200
1"""CLI commands for user accounts."""
3from typing import Optional, cast
5import gws
7from . import helper
9class AccountResetParams(gws.CliParams):
10 """Parameters of the ``accountReset`` command."""
12 uid: Optional[list[str]]
13 """List of account IDs to reset."""
18class Object(gws.Node):
19 """CLI commands for user accounts."""
21 @gws.ext.command.cli('accountReset')
22 def account_reset(self, p: AccountResetParams):
23 """Reset an account or multiple accounts."""
25 root = gws.load_root()
26 h = cast(helper.Object, root.app.helper('account'))
28 for uid in p.uid:
29 account = h.get_account_by_id(uid)
30 if not account:
31 continue
32 h.reset(account)
36 ##