# HG changeset patch # User Marcin Kuzminski # Date 2018-07-10 14:02:21 # Node ID 3d46d13dc48cab27734f16622a8af66add808fff # Parent 55dc8f3a65a07aa146ae872496a0e146dc415837 caches: flush cache when adding new objects so we can access them right away. diff --git a/rhodecode/apps/admin/views/repo_groups.py b/rhodecode/apps/admin/views/repo_groups.py --- a/rhodecode/apps/admin/views/repo_groups.py +++ b/rhodecode/apps/admin/views/repo_groups.py @@ -27,6 +27,7 @@ from pyramid.view import view_config from pyramid.renderers import render from pyramid.response import Response +from rhodecode import events from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode.lib.ext_json import json @@ -200,6 +201,7 @@ class AdminRepoGroupsView(BaseAppView, D % repo_group_name, category='error') raise HTTPFound(h.route_path('home')) + events.trigger(events.UserPermissionsChange([self._rhodecode_user.user_id])) raise HTTPFound( h.route_path('repo_group_home', repo_group_name=form_result['group_name_full'])) diff --git a/rhodecode/apps/admin/views/repositories.py b/rhodecode/apps/admin/views/repositories.py --- a/rhodecode/apps/admin/views/repositories.py +++ b/rhodecode/apps/admin/views/repositories.py @@ -27,6 +27,7 @@ from pyramid.view import view_config from pyramid.renderers import render from pyramid.response import Response +from rhodecode import events from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode.lib.celerylib.utils import get_task_id @@ -175,6 +176,8 @@ class AdminReposView(BaseAppView, DataGr h.flash(msg, category='error') raise HTTPFound(h.route_path('home')) + events.trigger(events.UserPermissionsChange([self._rhodecode_user.user_id])) + raise HTTPFound( h.route_path('repo_creating', repo_name=form_result['repo_name_full'], diff --git a/rhodecode/apps/admin/views/user_groups.py b/rhodecode/apps/admin/views/user_groups.py --- a/rhodecode/apps/admin/views/user_groups.py +++ b/rhodecode/apps/admin/views/user_groups.py @@ -28,6 +28,7 @@ from pyramid.view import view_config from pyramid.response import Response from pyramid.renderers import render +from rhodecode import events from rhodecode.apps._base import BaseAppView, DataGridAppView from rhodecode.lib.auth import ( LoginRequired, NotAnonymous, CSRFRequired, HasPermissionAnyDecorator) @@ -253,5 +254,6 @@ class AdminUserGroupsView(BaseAppView, D % user_group_name, category='error') raise HTTPFound(h.route_path('user_groups_new')) + events.trigger(events.UserPermissionsChange([self._rhodecode_user.user_id])) raise HTTPFound( h.route_path('edit_user_group', user_group_id=user_group_id))