def is_member_of_brewing_company(user, brewing_company):
    """Checks the user is a member of the brewing_company group.

    Args:
        user: The django user to check membership for.
        brewing_company: The BrewingCompany to check membership in its
            associated group.
    """
    if brewing_company.group is None:
        return False

    return user in brewing_company.group.user_set.all()