kolibri/plugins/coach/test/helpers.py
def create_coach(username, password, facility, classroom=None, is_facility_coach=False):
    """
    Create a coach.
    Assign them a classroom if specified.
    Grant facility permissions if is_facility_coach is True.
    """

    coach = FacilityUser.objects.create(username=username, facility=facility)
    coach.set_password(password)
    coach.save()

    if classroom is not None:
        classroom.add_coach(coach)

    if is_facility_coach:
        facility.add_coach(coach)

    return coach

    Create a coach.
    Assign them a classroom if specified.
    Grant facility permissions if is_facility_coach is True.
    
Create a coach.
Assign them a classroom if specified.
Grant facility permissions if is_facility_coach is True.
Create a coach . Assign them a classroom if specified . Grant facility permissions if is_facility_coach is True .
def create_coach(username, password, facility, classroom=None, is_facility_coach=False):
    coach = FacilityUser.objects.create(username=username, facility=facility)
    coach.set_password(password)
    coach.save()
    if classroom is not None:
        classroom.add_coach(coach)
    if is_facility_coach:
        facility.add_coach(coach)
    return coach
def create_coach ( username , password , facility , classroom = None , is_facility_coach = False ) : coach = FacilityUser . objects . create ( username = username , facility = facility ) coach . set_password ( password ) coach . save ( ) if classroom is not None : classroom . add_coach ( coach ) if is_facility_coach : facility . add_coach ( coach ) return coach
Create a coach.
Create a coach .
"""
    Create a coach.
    Assign them a classroom if specified.
    Grant facility permissions if is_facility_coach is True.
    """
username
password
facility
classroom
is_facility_coach