api/study_api.py
def edit_intervention(study_id=None):
    """
    Edits the name of the intervention. Expects intervention_id and edit_intervention in the
    request body
    """
    study = Study.objects.get(pk=study_id)
    intervention_id = request.values.get('intervention_id', None)
    new_name = request.values.get('edit_intervention', None)
    if intervention_id:
        try:
            intervention = Intervention.objects.get(id=intervention_id)
        except Intervention.DoesNotExist:
            intervention = None
        if intervention and new_name:
            intervention.name = new_name
            intervention.save()

    return redirect('/interventions/{:d}'.format(study.id))

    Edits the name of the intervention. Expects intervention_id and edit_intervention in the
    request body
    
Edits the name of the intervention. Expects intervention_id and edit_intervention in the
request body
Edits the name of the intervention . Expects intervention_id and edit_intervention in the request body
def edit_intervention(study_id=None):
    study = Study.objects.get(pk=study_id)
    intervention_id = request.values.get('intervention_id', None)
    new_name = request.values.get('edit_intervention', None)
    if intervention_id:
        try:
            intervention = Intervention.objects.get(id=intervention_id)
        except Intervention.DoesNotExist:
            intervention = None
        if intervention and new_name:
            intervention.name = new_name
            intervention.save()
    return redirect('/interventions/{:d}'.format(study.id))
def edit_intervention ( study_id = None ) : study = Study . objects . get ( pk = study_id ) intervention_id = request . values . get ( 'intervention_id' , None ) new_name = request . values . get ( 'edit_intervention' , None ) if intervention_id : try : intervention = Intervention . objects . get ( id = intervention_id ) except Intervention . DoesNotExist : intervention = None if intervention and new_name : intervention . name = new_name intervention . save ( ) return redirect ( '/interventions/{:d}' . format ( study . id ) )
Edits the name of the intervention.
Edits the name of the intervention .
"""
    Edits the name of the intervention. Expects intervention_id and edit_intervention in the
    request body
    """
study_id