Show More
@@ -9,9 +9,10 b' from pylons import request, response, se' | |||
|
9 | 9 | from pylons.controllers.util import abort, redirect |
|
10 | 10 | from pylons.i18n.translation import _ |
|
11 | 11 | |
|
12 | from sqlalchemy.exc import IntegrityError | |
|
13 | ||
|
12 | 14 | from rhodecode.lib import helpers as h |
|
13 |
from rhodecode.lib.auth import LoginRequired, HasPermissionA |
|
|
14 | HasPermissionAnyDecorator | |
|
15 | from rhodecode.lib.auth import LoginRequired, HasPermissionAnyDecorator | |
|
15 | 16 | from rhodecode.lib.base import BaseController, render |
|
16 | 17 | from rhodecode.model.db import Group |
|
17 | 18 | from rhodecode.model.repos_group import ReposGroupModel |
@@ -167,10 +168,21 b' class ReposGroupsController(BaseControll' | |||
|
167 | 168 | repos_group_model.delete(id) |
|
168 | 169 | h.flash(_('removed repos group %s' % gr.group_name), category='success') |
|
169 | 170 | #TODO: in future action_logger(, '', '', '', self.sa) |
|
171 | except IntegrityError, e: | |
|
172 | if e.message.find('groups_group_parent_id_fkey'): | |
|
173 | log.error(traceback.format_exc()) | |
|
174 | h.flash(_('Cannot delete this group it still contains ' | |
|
175 | 'subgroups'), | |
|
176 | category='warning') | |
|
177 | else: | |
|
178 | log.error(traceback.format_exc()) | |
|
179 | h.flash(_('error occurred during deletion of repos ' | |
|
180 | 'group %s' % gr.group_name), category='error') | |
|
181 | ||
|
170 | 182 | except Exception: |
|
171 | 183 | log.error(traceback.format_exc()) |
|
172 |
h.flash(_('error occurred during deletion of repos |
|
|
173 | category='error') | |
|
184 | h.flash(_('error occurred during deletion of repos ' | |
|
185 | 'group %s' % gr.group_name), category='error') | |
|
174 | 186 | |
|
175 | 187 | return redirect(url('repos_groups')) |
|
176 | 188 |
General Comments 0
You need to be logged in to leave comments.
Login now