##// END OF EJS Templates
pyramid: removed pylons reference from apps....
marcink -
r1782:33dbb293 default
parent child Browse files
Show More
@@ -21,7 +21,7 b''
21 21 import collections
22 22 import logging
23 23
24 from pylons import tmpl_context as c
24
25 25 from pyramid.view import view_config
26 26
27 27 from rhodecode.apps._base import BaseAppView
@@ -34,15 +34,21 b' log = logging.getLogger(__name__)'
34 34
35 35 class OpenSourceLicensesAdminSettingsView(BaseAppView):
36 36
37 def load_default_context(self):
38 c = self._get_local_tmpl_context()
39 self._register_global_c(c)
40 return c
41
37 42 @LoginRequired()
38 43 @HasPermissionAllDecorator('hg.admin')
39 44 @view_config(
40 45 route_name='admin_settings_open_source', request_method='GET',
41 46 renderer='rhodecode:templates/admin/settings/settings.mako')
42 47 def open_source_licenses(self):
48 c = self.load_default_context()
43 49 c.active = 'open_source'
44 50 c.navlist = navigation_list(self.request)
45 51 c.opensource_licenses = collections.OrderedDict(
46 52 sorted(read_opensource_licenses().items(), key=lambda t: t[0]))
47 53
48 return {}
54 return self._get_template_context(c)
@@ -20,7 +20,6 b''
20 20
21 21 import logging
22 22
23 from pylons import tmpl_context as c
24 23 from pyramid.view import view_config
25 24 from pyramid.httpexceptions import HTTPFound
26 25
@@ -37,6 +36,11 b' log = logging.getLogger(__name__)'
37 36
38 37
39 38 class AdminSessionSettingsView(BaseAppView):
39 def load_default_context(self):
40 c = self._get_local_tmpl_context()
41
42 self._register_global_c(c)
43 return c
40 44
41 45 @LoginRequired()
42 46 @HasPermissionAllDecorator('hg.admin')
@@ -44,6 +48,8 b' class AdminSessionSettingsView(BaseAppVi'
44 48 route_name='admin_settings_sessions', request_method='GET',
45 49 renderer='rhodecode:templates/admin/settings/settings.mako')
46 50 def settings_sessions(self):
51 c = self.load_default_context()
52
47 53 c.active = 'sessions'
48 54 c.navlist = navigation_list(self.request)
49 55
@@ -59,7 +65,7 b' class AdminSessionSettingsView(BaseAppVi'
59 65 c.session_expired_count = c.session_model.get_expired_count(
60 66 older_than_seconds)
61 67
62 return {}
68 return self._get_template_context(c)
63 69
64 70 @LoginRequired()
65 71 @CSRFRequired()
@@ -22,7 +22,6 b' import logging'
22 22 import urllib2
23 23 import packaging.version
24 24
25 from pylons import tmpl_context as c
26 25 from pyramid.view import view_config
27 26
28 27 import rhodecode
@@ -39,6 +38,10 b' log = logging.getLogger(__name__)'
39 38
40 39
41 40 class AdminSystemInfoSettingsView(BaseAppView):
41 def load_default_context(self):
42 c = self._get_local_tmpl_context()
43 self._register_global_c(c)
44 return c
42 45
43 46 @staticmethod
44 47 def get_update_data(update_url):
@@ -64,6 +67,7 b' class AdminSystemInfoSettingsView(BaseAp'
64 67 renderer='rhodecode:templates/admin/settings/settings.mako')
65 68 def settings_system_info(self):
66 69 _ = self.request.translate
70 c = self.load_default_context()
67 71
68 72 c.active = 'system'
69 73 c.navlist = navigation_list(self.request)
@@ -164,7 +168,7 b' class AdminSystemInfoSettingsView(BaseAp'
164 168 else:
165 169 self.request.session.flash(
166 170 'You are not allowed to do this', queue='warning')
167 return {}
171 return self._get_template_context(c)
168 172
169 173 @LoginRequired()
170 174 @HasPermissionAllDecorator('hg.admin')
@@ -173,6 +177,7 b' class AdminSystemInfoSettingsView(BaseAp'
173 177 renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
174 178 def settings_system_info_check_update(self):
175 179 _ = self.request.translate
180 c = self.load_default_context()
176 181
177 182 update_url = self.get_update_url()
178 183
@@ -201,4 +206,4 b' class AdminSystemInfoSettingsView(BaseAp'
201 206 c.should_upgrade = True
202 207 c.important_notices = latest['general']
203 208
204 return {}
209 return self._get_template_context(c)
@@ -30,8 +30,6 b' Channel Stream controller for rhodecode'
30 30 import logging
31 31 import uuid
32 32
33 from pylons import tmpl_context as c
34 from pyramid.settings import asbool
35 33 from pyramid.view import view_config
36 34 from webob.exc import HTTPBadRequest, HTTPForbidden, HTTPBadGateway
37 35
@@ -46,7 +44,6 b' from rhodecode.lib.channelstream import '
46 44 update_history_from_logs,
47 45 STATE_PUBLIC_KEYS)
48 46 from rhodecode.lib.auth import NotAnonymous
49 from rhodecode.lib.utils2 import str2bool
50 47
51 48 log = logging.getLogger(__name__)
52 49
@@ -82,7 +79,7 b' class ChannelstreamView(object):'
82 79 log.error('Incorrect permissions for requested channels')
83 80 raise HTTPForbidden()
84 81
85 user = c.rhodecode_user
82 user = self._rhodecode_user
86 83 if user.user_id:
87 84 user_data = get_user_data(user.user_id)
88 85 else:
@@ -95,7 +92,7 b' class ChannelstreamView(object):'
95 92 'display_name': None,
96 93 'display_link': None,
97 94 }
98 user_data['permissions'] = c.rhodecode_user.permissions
95 user_data['permissions'] = self._rhodecode_user.permissions
99 96 payload = {
100 97 'username': user.username,
101 98 'user_state': user_data,
General Comments 0
You need to be logged in to leave comments. Login now