##// END OF EJS Templates
comments: remove usage of pylons global config.
marcink -
r2005:08e45e06 default
parent child Browse files
Show More
@@ -26,8 +26,6 b' import logging'
26 import traceback
26 import traceback
27 import collections
27 import collections
28
28
29 from datetime import datetime
30
31 from pylons.i18n.translation import _
29 from pylons.i18n.translation import _
32 from pyramid.threadlocal import get_current_registry, get_current_request
30 from pyramid.threadlocal import get_current_registry, get_current_request
33 from sqlalchemy.sql.expression import null
31 from sqlalchemy.sql.expression import null
@@ -35,7 +33,6 b' from sqlalchemy.sql.functions import coa'
35
33
36 from rhodecode.lib import helpers as h, diffs, channelstream
34 from rhodecode.lib import helpers as h, diffs, channelstream
37 from rhodecode.lib import audit_logger
35 from rhodecode.lib import audit_logger
38 from rhodecode.lib.channelstream import channelstream_request
39 from rhodecode.lib.utils2 import extract_mentioned_users, safe_str
36 from rhodecode.lib.utils2 import extract_mentioned_users, safe_str
40 from rhodecode.model import BaseModel
37 from rhodecode.model import BaseModel
41 from rhodecode.model.db import (
38 from rhodecode.model.db import (
@@ -72,10 +69,10 b' class CommentsModel(BaseModel):'
72 return user_objects
69 return user_objects
73
70
74 def _get_renderer(self, global_renderer='rst'):
71 def _get_renderer(self, global_renderer='rst'):
72 request = get_current_request()
73
75 try:
74 try:
76 # try reading from visual context
75 global_renderer = request.call_context.visual.default_renderer
77 from pylons import tmpl_context
78 global_renderer = tmpl_context.visual.default_renderer
79 except AttributeError:
76 except AttributeError:
80 log.debug("Renderer not set, falling back "
77 log.debug("Renderer not set, falling back "
81 "to default renderer '%s'", global_renderer)
78 "to default renderer '%s'", global_renderer)
General Comments 0
You need to be logged in to leave comments. Login now