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

1from typing import Optional, cast 

2 

3import gws 

4import gws.config 

5 

6from . import helper 

7 

8class AccountResetParams(gws.CliParams): 

9 uid: Optional[list[str]] 

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

11 

12 

13 

14 

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')) 

20 

21 for uid in p.uid: 

22 account = h.get_account_by_id(uid) 

23 if not account: 

24 continue 

25 h.reset(account) 

26 

27 

28 

29 ## 

30