__is_member.py 185 Bytes
Newer Older
1
2
3
4
5
6
7
def is_member(group_name, user):
    """
    Function to know if a user is part of a specific group.

    TODO unit test
    """
    return user.groups.filter(name=group_name).exists()