Coverage for gws-app / gws / plugin / account / cli.py: 0%
17 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-03 10:12 +0100
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-03 10:12 +0100
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 """Reset an account or multiple accounts."""
20 root = gws.config.load()
21 h = cast(helper.Object, root.app.helper('account'))
23 for uid in p.uid:
24 account = h.get_account_by_id(uid)
25 if not account:
26 continue
27 h.reset(account)
31 ##