Show More
@@ -30,7 +30,7 b' account permissions.' | |||
|
30 | 30 | # Use this example to change user permissions |
|
31 | 31 | In [1]: adminuser = User.get_by_username('username') |
|
32 | 32 | In [2]: adminuser.admin = True |
|
33 | In [3]: Session.add(adminuser);Session().commit() | |
|
33 | In [3]: Session().add(adminuser);Session().commit() | |
|
34 | 34 | In [4]: exit() |
|
35 | 35 | |
|
36 | 36 | Set to read global ``.hgrc`` file |
@@ -265,7 +265,7 b' def merge_pull_request(request, apiuser,' | |||
|
265 | 265 | PullRequestModel().close_pull_request( |
|
266 | 266 | pull_request.pull_request_id, apiuser) |
|
267 | 267 | |
|
268 | Session.commit() | |
|
268 | Session().commit() | |
|
269 | 269 | return data |
|
270 | 270 | |
|
271 | 271 | |
@@ -319,7 +319,7 b' def close_pull_request(request, apiuser,' | |||
|
319 | 319 | |
|
320 | 320 | PullRequestModel().close_pull_request( |
|
321 | 321 | pull_request.pull_request_id, apiuser) |
|
322 | Session.commit() | |
|
322 | Session().commit() | |
|
323 | 323 | data = { |
|
324 | 324 | 'pull_request_id': pull_request.pull_request_id, |
|
325 | 325 | 'closed': True, |
@@ -96,7 +96,7 b' class AuthnPluginViewBase(object):' | |||
|
96 | 96 | # Store validated data. |
|
97 | 97 | for name, value in valid_data.items(): |
|
98 | 98 | self.plugin.create_or_update_setting(name, value) |
|
99 | Session.commit() | |
|
99 | Session().commit() | |
|
100 | 100 | |
|
101 | 101 | # Display success message and redirect. |
|
102 | 102 | self.request.session.flash( |
@@ -244,7 +244,7 b' class JournalController(BaseController):' | |||
|
244 | 244 | try: |
|
245 | 245 | self.scm_model.toggle_following_user( |
|
246 | 246 | user_id, c.rhodecode_user.user_id) |
|
247 | Session.commit() | |
|
247 | Session().commit() | |
|
248 | 248 | return 'ok' |
|
249 | 249 | except Exception: |
|
250 | 250 | raise HTTPBadRequest() |
@@ -254,7 +254,7 b' class JournalController(BaseController):' | |||
|
254 | 254 | try: |
|
255 | 255 | self.scm_model.toggle_following_repo( |
|
256 | 256 | repo_id, c.rhodecode_user.user_id) |
|
257 | Session.commit() | |
|
257 | Session().commit() | |
|
258 | 258 | return 'ok' |
|
259 | 259 | except Exception: |
|
260 | 260 | raise HTTPBadRequest() |
@@ -198,7 +198,7 b' class SettingsModel(BaseModel):' | |||
|
198 | 198 | # update if set |
|
199 | 199 | res.app_settings_value = val |
|
200 | 200 | |
|
201 | Session.add(res) | |
|
201 | Session().add(res) | |
|
202 | 202 | return res |
|
203 | 203 | |
|
204 | 204 | def invalidate_settings_cache(self): |
@@ -67,7 +67,7 b' class TestAuthSettingsController(object)' | |||
|
67 | 67 | for _plugin in _enabled_plugins: |
|
68 | 68 | db_plugin = SettingsModel().get_setting_by_name(_plugin) |
|
69 | 69 | if db_plugin: |
|
70 | Session.delete(db_plugin) | |
|
70 | Session().delete(db_plugin) | |
|
71 | 71 | Session().commit() |
|
72 | 72 | |
|
73 | 73 | response = self.app.post(url=test_url, params=params) |
@@ -1189,8 +1189,8 b' class UserUtility(object):' | |||
|
1189 | 1189 | def _inherit_default_user_permissions(self, user_name, value): |
|
1190 | 1190 | user = UserModel().get_by_username(user_name) |
|
1191 | 1191 | user.inherit_default_permissions = value |
|
1192 | Session.add(user) | |
|
1193 | Session.commit() | |
|
1192 | Session().add(user) | |
|
1193 | Session().commit() | |
|
1194 | 1194 | |
|
1195 | 1195 | def cleanup(self): |
|
1196 | 1196 | self._cleanup_permissions() |
General Comments 0
You need to be logged in to leave comments.
Login now