comparison rhodecode/controllers/admin/repos_groups.py @ 2497:5a8c19c4dbe1 beta

Fixed bug in repos group discovery, when inner folder of bare git repos were detected as a group
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 20 Jun 2012 22:13:23 +0200
parents fddd8e3fc157
children 94ae02ca5f00
comparison
equal deleted inserted replaced
2496:fddd8e3fc157 2497:5a8c19c4dbe1
42 from rhodecode.model.db import RepoGroup 42 from rhodecode.model.db import RepoGroup
43 from rhodecode.model.repos_group import ReposGroupModel 43 from rhodecode.model.repos_group import ReposGroupModel
44 from rhodecode.model.forms import ReposGroupForm 44 from rhodecode.model.forms import ReposGroupForm
45 from rhodecode.model.meta import Session 45 from rhodecode.model.meta import Session
46 from rhodecode.model.repo import RepoModel 46 from rhodecode.model.repo import RepoModel
47 from webob.exc import HTTPInternalServerError 47 from webob.exc import HTTPInternalServerError, HTTPNotFound
48 48
49 log = logging.getLogger(__name__) 49 log = logging.getLogger(__name__)
50 50
51 51
52 class ReposGroupsController(BaseController): 52 class ReposGroupsController(BaseController):
266 """ 266 """
267 This is a proxy that does a lookup group_name -> id, and shows 267 This is a proxy that does a lookup group_name -> id, and shows
268 the group by id view instead 268 the group by id view instead
269 """ 269 """
270 group_name = group_name.rstrip('/') 270 group_name = group_name.rstrip('/')
271 id_ = RepoGroup.get_by_group_name(group_name).group_id 271 id_ = RepoGroup.get_by_group_name(group_name)
272 return self.show(id_) 272 if id_:
273 return self.show(id_.group_id)
274 raise HTTPNotFound
273 275
274 @HasReposGroupPermissionAnyDecorator('group.read', 'group.write', 276 @HasReposGroupPermissionAnyDecorator('group.read', 'group.write',
275 'group.admin') 277 'group.admin')
276 def show(self, id, format='html'): 278 def show(self, id, format='html'):
277 """GET /repos_groups/id: Show a specific item""" 279 """GET /repos_groups/id: Show a specific item"""