Browse Source

不显示默认的group

pull/6/head
guanghongwei 10 years ago
parent
commit
308379406a
  1. 5
      jumpserver/templatetags/mytags.py

5
jumpserver/templatetags/mytags.py

@ -31,11 +31,8 @@ def get_role(user_id):
def groups_str(username):
groups = []
user = User.objects.get(username=username)
group_default = UserGroup.objects.get(name=username)
for group in user.user_group.all():
for group in user.user_group.filter(type='M'):
groups.append(group.name)
if group_default in groups:
groups.remove(group_default)
return ','.join(groups)

Loading鈥
Cancel
Save