api/study_api.py
def delete_intervention(study_id=None):
    """Deletes the specified Intervention. Expects intervention in the request body."""
    study = Study.objects.get(pk=study_id)
    intervention_id = request.values.get('intervention')
    if intervention_id:
        try:
            intervention = Intervention.objects.get(id=intervention_id)
        except Intervention.DoesNotExist:
            intervention = None
        try:
            if intervention:
                intervention.delete()
        except ProtectedError:
            flash("This Intervention can not be removed because it is already in use", 'danger')

    return redirect('/interventions/{:d}'.format(study.id))
Deletes the specified Intervention. Expects intervention in the request body.
Deletes the specified Intervention. Expects intervention in the request body.
Deletes the specified Intervention . Expects intervention in the request body .
def delete_intervention(study_id=None):
    study = Study.objects.get(pk=study_id)
    intervention_id = request.values.get('intervention')
    if intervention_id:
        try:
            intervention = Intervention.objects.get(id=intervention_id)
        except Intervention.DoesNotExist:
            intervention = None
        try:
            if intervention:
                intervention.delete()
        except ProtectedError:
            flash("This Intervention can not be removed because it is already in use", 'danger')
    return redirect('/interventions/{:d}'.format(study.id))
def delete_intervention ( study_id = None ) : study = Study . objects . get ( pk = study_id ) intervention_id = request . values . get ( 'intervention' ) if intervention_id : try : intervention = Intervention . objects . get ( id = intervention_id ) except Intervention . DoesNotExist : intervention = None try : if intervention : intervention . delete ( ) except ProtectedError : flash ( "This Intervention can not be removed because it is already in use" , 'danger' ) return redirect ( '/interventions/{:d}' . format ( study . id ) )
Deletes the specified Intervention.
Deletes the specified Intervention .
"""Deletes the specified Intervention. Expects intervention in the request body."""
study_id