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
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
1from typing import Optional
3import gws
4import gws.base.action
5import gws.base.auth.user
6import gws.lib.intl
8from . import core
10gws.ext.new.action('project')
13class Config(gws.base.action.Config):
14 pass
17class Props(gws.base.action.Props):
18 pass
21class InfoResponse(gws.Response):
22 project: gws.ext.props.project
23 locale: gws.Locale
24 user: Optional[gws.base.auth.user.Props]
27class Object(gws.base.action.Object):
28 """Project information action"""
30 @gws.ext.command.api('projectInfo')
31 def info(self, req: gws.WebRequester, p: gws.Request) -> InfoResponse:
32 """Return the project configuration"""
34 project = req.user.require_project(p.projectUid)
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))