不显示默认的group

pull/6/head
guanghongwei 2015-01-27 18:02:51 +08:00
parent 047dda5ab3
commit c04237ac76
1 changed files with 3 additions and 1 deletions

View File

@ -34,9 +34,11 @@ def groups_str(username):
group_default = UserGroup.objects.get(name=username)
for group in user.user_group.all():
groups.append(group.name)
groups.remove(group_default)
if group_default in groups:
groups.remove(group_default)
return ','.join(groups)
@register.filter(name='get_item')
def get_item(dictionary, key):
return dictionary.get(key)