golf/templatetags/user_tags.py
def has_group(user, group_name):
    """
    Verify the user has a group_name in groups
    """
    groups = user.groups.all().values_list('name', flat=True)
    return True if group_name in groups else False

    Verify the user has a group_name in groups
    
Verify the user has a group_name in groups
Verify the user has a group_name in groups
def has_group(user, group_name):
    groups = user.groups.all().values_list('name', flat=True)
    return True if group_name in groups else False
def has_group ( user , group_name ) : groups = user . groups . all ( ) . values_list ( 'name' , flat = True ) return True if group_name in groups else False
Verify the user has a group_name in groups
Verify the user has a group_name in groups
"""
    Verify the user has a group_name in groups
    """
user
group_name