Coverage for gws-app/gws/plugin/account/cli.py: 0%
17 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
1from typing import Optional, cast
3import gws
4import gws.config
6from . import helper
8class AccountResetParams(gws.CliParams):
9 uid: Optional[list[str]]
10 """List of account IDs to reset."""
15class Object(gws.Node):
16 @gws.ext.command.cli('accountReset')
17 def account_reset(self, p: AccountResetParams):
18 root = gws.config.load()
19 h = cast(helper.Object, root.app.helper('account'))
21 for uid in p.uid:
22 account = h.get_account_by_id(uid)
23 if not account:
24 continue
25 h.reset(account)
29 ##