Mercurial > kallithea
diff rhodecode/model/user.py @ 2124:273ce1a99c3f beta
fixed #397 Private repository groups shows up before login
- added relevant test for this issue
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 13 Mar 2012 02:39:31 +0200 |
parents | 8ecfed1d8f8b |
children | 43481c3d70ca |
line wrap: on
line diff
--- a/rhodecode/model/user.py Mon Mar 12 21:32:58 2012 +0200 +++ b/rhodecode/model/user.py Tue Mar 13 02:39:31 2012 +0200 @@ -298,14 +298,15 @@ try: if user.username == 'default': raise DefaultUserException( - _("You can't remove this user since it's" - " crucial for entire application")) + _("You can't remove this user since it's" + " crucial for entire application") + ) if user.repositories: - raise UserOwnsReposException(_('This user still owns %s ' - 'repositories and cannot be ' - 'removed. Switch owners or ' - 'remove those repositories') \ - % user.repositories) + raise UserOwnsReposException( + _('user "%s" still owns %s repositories and cannot be ' + 'removed. Switch owners or remove those repositories') + % (user.username, user.repositories) + ) self.sa.delete(user) except: log.error(traceback.format_exc()) @@ -500,7 +501,7 @@ self.sa.query(UserRepoGroupToPerm, Permission, RepoGroup)\ .join((RepoGroup, UserRepoGroupToPerm.group_id == RepoGroup.group_id))\ .join((Permission, UserRepoGroupToPerm.permission_id == Permission.permission_id))\ - .filter(UserRepoToPerm.user_id == uid)\ + .filter(UserRepoGroupToPerm.user_id == uid)\ .all() for perm in user_repo_groups_perms: @@ -509,7 +510,6 @@ cur_perm = user.permissions[GK][rg_k] if PERM_WEIGHTS[p] > PERM_WEIGHTS[cur_perm]: user.permissions[GK][rg_k] = p - return user def has_perm(self, user, perm):