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

1"""CLI commands for user accounts.""" 

2 

3from typing import Optional, cast 

4 

5import gws 

6 

7from . import helper 

8 

9class AccountResetParams(gws.CliParams): 

10 """Parameters of the ``accountReset`` command.""" 

11 

12 uid: Optional[list[str]] 

13 """List of account IDs to reset.""" 

14 

15 

16 

17 

18class Object(gws.Node): 

19 """CLI commands for user accounts.""" 

20 

21 @gws.ext.command.cli('accountReset') 

22 def account_reset(self, p: AccountResetParams): 

23 """Reset an account or multiple accounts.""" 

24 

25 root = gws.load_root() 

26 h = cast(helper.Object, root.app.helper('account')) 

27 

28 for uid in p.uid: 

29 account = h.get_account_by_id(uid) 

30 if not account: 

31 continue 

32 h.reset(account) 

33 

34 

35 

36 ## 

37