Merge branch 'guntherweissenbaeck/issue2' of github.com:guntherweissenbaeck/django_fbf into guntherweissenbaeck/issue2
This commit is contained in:
commit
156d6fd6c7
1 changed files with 5 additions and 4 deletions
|
@ -1,9 +1,10 @@
|
|||
from django import template
|
||||
from django.contrib.auth.models import Group
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter(name='group_check')
|
||||
def has_group(user, group_name):
|
||||
group = Group.objects.get(name=group_name)
|
||||
|
||||
@register.filter(name="group_check")
|
||||
def has_group(user, group_name):
|
||||
group = Group.objects.get(name=group_name)
|
||||
return True if group in user.groups.all() else False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue