##// END OF EJS Templates
user-autocomplete: allow skipping default user.
marcink -
r1768:ea751575 default
parent child Browse files
Show More
@@ -54,6 +54,7 b' class HomeView(BaseAppView):'
54 active = str2bool(self.request.GET.get('active') or True)
54 active = str2bool(self.request.GET.get('active') or True)
55 include_groups = str2bool(self.request.GET.get('user_groups'))
55 include_groups = str2bool(self.request.GET.get('user_groups'))
56 expand_groups = str2bool(self.request.GET.get('user_groups_expand'))
56 expand_groups = str2bool(self.request.GET.get('user_groups_expand'))
57 skip_default_user = str2bool(self.request.GET.get('skip_default_user'))
57
58
58 log.debug('generating user list, query:%s, active:%s, with_groups:%s',
59 log.debug('generating user list, query:%s, active:%s, with_groups:%s',
59 query, active, include_groups)
60 query, active, include_groups)
@@ -61,6 +62,12 b' class HomeView(BaseAppView):'
61 _users = UserModel().get_users(
62 _users = UserModel().get_users(
62 name_contains=query, only_active=active)
63 name_contains=query, only_active=active)
63
64
65 def maybe_skip_default_user(usr):
66 if skip_default_user and usr['username'] == UserModel.cls.DEFAULT_USER:
67 return False
68 return True
69 _users = filter(maybe_skip_default_user, _users)
70
64 if include_groups:
71 if include_groups:
65 # extend with user groups
72 # extend with user groups
66 _user_groups = UserGroupModel().get_user_groups(
73 _user_groups = UserGroupModel().get_user_groups(
General Comments 0
You need to be logged in to leave comments. Login now