Mercurial > kallithea
diff rhodecode/controllers/admin/repos_groups.py @ 1346:cf78d302d441 beta
#47 implemented deleting of empty groups. Fixed problem with full paths on nested groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 23 May 2011 02:46:43 +0200 |
parents | 3bce31f026b8 |
children | 43b8e161be3f |
line wrap: on
line diff
--- a/rhodecode/controllers/admin/repos_groups.py Mon May 23 02:22:00 2011 +0200 +++ b/rhodecode/controllers/admin/repos_groups.py Mon May 23 02:46:43 2011 +0200 @@ -112,6 +112,27 @@ # method='delete') # url('repos_group', id=ID) + repos_group_model = ReposGroupModel() + gr = Group.get(id) + repos = gr.repositories.all() + if repos: + h.flash(_('This group contains %s repositores and cannot be ' + 'deleted' % len(repos)), + category='error') + return redirect(url('repos_groups')) + + + try: + repos_group_model.delete(id) + h.flash(_('removed repos group %s' % gr.group_name), category='success') + #TODO: in futureaction_logger(, '', '', '', self.sa) + except Exception: + log.error(traceback.format_exc()) + h.flash(_('error occurred during deletion of repos group %s' % gr.group_name), + category='error') + + return redirect(url('repos_groups')) + def show(self, id, format='html'): """GET /repos_groups/id: Show a specific item""" # url('repos_group', id=ID)