Changeset - a732bbc40c7e
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-04-30 15:32:04
marcin@python-works.com
hide listing of default user

- there's no option to edit this user, so listing doesn't make sense
- listing and showing builtin default user is confusing
2 files changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/users.py
Show inline comments
 
@@ -68,7 +68,9 @@ class UsersController(BaseController):
 
        """GET /users: All items in the collection"""
 
        # url('users')
 

	
 
        c.users_list = User.query().order_by(User.username).all()
 
        c.users_list = User.query().order_by(User.username)\
 
                        .filter(User.username != User.DEFAULT_USER)\
 
                        .all()
 

	
 
        users_data = []
 
        total_records = len(c.users_list)
rhodecode/controllers/api/api.py
Show inline comments
 
@@ -41,8 +41,9 @@ from rhodecode.model.repo import RepoMod
 
from rhodecode.model.user import UserModel
 
from rhodecode.model.users_group import UserGroupModel
 
from rhodecode.model.db import Repository, RhodeCodeSetting, UserIpMap,\
 
    Permission
 
    Permission, User
 
from rhodecode.lib.compat import json
 
from rhodecode.lib.exceptions import DefaultUserException
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -377,7 +378,10 @@ class ApiController(JSONRPCController):
 
        """
 

	
 
        result = []
 
        for user in UserModel().get_all():
 
        users_list = User.query().order_by(User.username)\
 
                        .filter(User.username != User.DEFAULT_USER)\
 
                        .all()
 
        for user in users_list:
 
            result.append(user.get_api_data())
 
        return result
 

	
 
@@ -477,6 +481,9 @@ class ApiController(JSONRPCController):
 
                msg='updated user ID:%s %s' % (user.user_id, user.username),
 
                user=user.get_api_data()
 
            )
 
        except DefaultUserException:
 
            log.error(traceback.format_exc())
 
            raise JSONRPCError('editing default user is forbidden')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            raise JSONRPCError('failed to update user `%s`' % userid)
0 comments (0 inline, 0 general)