File tree 1 file changed +2
-10
lines changed 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 1
1
import hashlib
2
2
import os .path
3
3
4
- from jinja2 import Environment , FileSystemLoader
4
+ from pyramid_jinja2 import IJinja2Environment
5
5
6
6
import warehouse
7
7
11
11
def render_simple_detail (project , request , store = False ):
12
12
context = _simple_detail (project , request )
13
13
14
- # TODO: use pyramid_jinja2 "get_jinja2_environment" method instead:
15
- # https://docs.pylonsproject.org/projects/pyramid_jinja2/en/latest/api.html#pyramid_jinja2.get_jinja2_environment
16
- dir_name = os .path .join (os .path .dirname (warehouse .__file__ ), "templates" )
17
- env = Environment (
18
- loader = FileSystemLoader (dir_name ),
19
- extensions = [],
20
- cache_size = 0 ,
21
- )
22
-
14
+ env = request .registry .queryUtility (IJinja2Environment , name = ".jinja2" )
23
15
template = env .get_template ("legacy/api/simple/detail.html" )
24
16
content = template .render (** context , request = request )
25
17
You can’t perform that action at this time.
0 commit comments