不显示默认的group

pull/6/head
guanghongwei 2015-01-27 18:05:53 +08:00
parent c04237ac76
commit 308379406a
1 changed files with 1 additions and 4 deletions

View File

@ -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)