Show More
@@ -68,7 +68,9 b' class UsersController(BaseController):' | |||||
68 | """GET /users: All items in the collection""" |
|
68 | """GET /users: All items in the collection""" | |
69 | # url('users') |
|
69 | # url('users') | |
70 |
|
70 | |||
71 |
c.users_list = User.query().order_by(User.username) |
|
71 | c.users_list = User.query().order_by(User.username)\ | |
|
72 | .filter(User.username != User.DEFAULT_USER)\ | |||
|
73 | .all() | |||
72 |
|
74 | |||
73 | users_data = [] |
|
75 | users_data = [] | |
74 | total_records = len(c.users_list) |
|
76 | total_records = len(c.users_list) |
@@ -41,8 +41,9 b' from rhodecode.model.repo import RepoMod' | |||||
41 | from rhodecode.model.user import UserModel |
|
41 | from rhodecode.model.user import UserModel | |
42 | from rhodecode.model.users_group import UserGroupModel |
|
42 | from rhodecode.model.users_group import UserGroupModel | |
43 | from rhodecode.model.db import Repository, RhodeCodeSetting, UserIpMap,\ |
|
43 | from rhodecode.model.db import Repository, RhodeCodeSetting, UserIpMap,\ | |
44 | Permission |
|
44 | Permission, User | |
45 | from rhodecode.lib.compat import json |
|
45 | from rhodecode.lib.compat import json | |
|
46 | from rhodecode.lib.exceptions import DefaultUserException | |||
46 |
|
47 | |||
47 | log = logging.getLogger(__name__) |
|
48 | log = logging.getLogger(__name__) | |
48 |
|
49 | |||
@@ -377,7 +378,10 b' class ApiController(JSONRPCController):' | |||||
377 | """ |
|
378 | """ | |
378 |
|
379 | |||
379 | result = [] |
|
380 | result = [] | |
380 | for user in UserModel().get_all(): |
|
381 | users_list = User.query().order_by(User.username)\ | |
|
382 | .filter(User.username != User.DEFAULT_USER)\ | |||
|
383 | .all() | |||
|
384 | for user in users_list: | |||
381 | result.append(user.get_api_data()) |
|
385 | result.append(user.get_api_data()) | |
382 | return result |
|
386 | return result | |
383 |
|
387 | |||
@@ -477,6 +481,9 b' class ApiController(JSONRPCController):' | |||||
477 | msg='updated user ID:%s %s' % (user.user_id, user.username), |
|
481 | msg='updated user ID:%s %s' % (user.user_id, user.username), | |
478 | user=user.get_api_data() |
|
482 | user=user.get_api_data() | |
479 | ) |
|
483 | ) | |
|
484 | except DefaultUserException: | |||
|
485 | log.error(traceback.format_exc()) | |||
|
486 | raise JSONRPCError('editing default user is forbidden') | |||
480 | except Exception: |
|
487 | except Exception: | |
481 | log.error(traceback.format_exc()) |
|
488 | log.error(traceback.format_exc()) | |
482 | raise JSONRPCError('failed to update user `%s`' % userid) |
|
489 | raise JSONRPCError('failed to update user `%s`' % userid) |
General Comments 0
You need to be logged in to leave comments.
Login now