Coverage for gws-app/gws/base/project/action.py: 0%

20 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-17 01:37 +0200

1from typing import Optional 

2 

3import gws 

4import gws.base.action 

5import gws.base.auth.user 

6import gws.lib.intl 

7 

8from . import core 

9 

10gws.ext.new.action('project') 

11 

12 

13class Config(gws.base.action.Config): 

14 pass 

15 

16 

17class Props(gws.base.action.Props): 

18 pass 

19 

20 

21class InfoResponse(gws.Response): 

22 project: gws.ext.props.project 

23 locale: gws.Locale 

24 user: Optional[gws.base.auth.user.Props] 

25 

26 

27class Object(gws.base.action.Object): 

28 """Project information action""" 

29 

30 @gws.ext.command.api('projectInfo') 

31 def info(self, req: gws.WebRequester, p: gws.Request) -> InfoResponse: 

32 """Return the project configuration""" 

33 

34 project = req.user.require_project(p.projectUid) 

35 

36 return InfoResponse( 

37 project=gws.props_of(project, req.user), 

38 locale=gws.lib.intl.locale(p.localeUid, project.localeUids), 

39 user=None if req.user.isGuest else gws.props_of(req.user, req.user))