Coverage for /home/runner/work/viur-core/viur-core/viur/src/viur/core/modules/site.py: 0%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.3, created at 2024-10-16 22:16 +0000

1from viur.core import Module, errors 

2from viur.core.decorators import exposed 

3 

4 

5class Site(Module): 

6 adminInfo = None 

7 

8 @exposed 

9 def index(self, template="index", *arg, **kwargs): 

10 if ".." in template or "/" in template: 

11 return 

12 

13 try: 

14 template = self.render.getEnv().get_template(self.render.getTemplateFileName("sites/" + template)) 

15 except: 

16 raise errors.NotFound() 

17 

18 return template.render() 

19 

20 

21Site.html = True