Mercurial > kallithea
comparison rhodecode/model/user.py @ 2153:fa637dc3e029 beta
Improved message about deleting user who owns repositories
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 22 Mar 2012 01:45:58 +0200 |
parents | a8c9c0094ddf |
children | dc2584ba5fbc 7b52c2351231 |
comparison
equal
deleted
inserted
replaced
2152:e14ae8437548 | 2153:fa637dc3e029 |
---|---|
297 user = self.__get_user(user) | 297 user = self.__get_user(user) |
298 | 298 |
299 try: | 299 try: |
300 if user.username == 'default': | 300 if user.username == 'default': |
301 raise DefaultUserException( | 301 raise DefaultUserException( |
302 _("You can't remove this user since it's" | 302 _(u"You can't remove this user since it's" |
303 " crucial for entire application") | 303 " crucial for entire application") |
304 ) | 304 ) |
305 if user.repositories: | 305 if user.repositories: |
306 repos = [x.repo_name for x in user.repositories] | |
306 raise UserOwnsReposException( | 307 raise UserOwnsReposException( |
307 _('user "%s" still owns %s repositories and cannot be ' | 308 _(u'user "%s" still owns %s repositories and cannot be ' |
308 'removed. Switch owners or remove those repositories') | 309 'removed. Switch owners or remove those repositories. %s') |
309 % (user.username, user.repositories) | 310 % (user.username, len(repos), ', '.join(repos)) |
310 ) | 311 ) |
311 self.sa.delete(user) | 312 self.sa.delete(user) |
312 except: | 313 except: |
313 log.error(traceback.format_exc()) | 314 log.error(traceback.format_exc()) |
314 raise | 315 raise |