Add phenotype(s) to the case model.

def phenotypes():
    """Add phenotype(s) to the case model."""
    ind_id = request.form['ind_id']
    phenotype_id = request.form['phenotype_id']

    if not phenotype_id:
        return abort(500, 'no phenotype_id submitted')

    ind_obj = app.db.individual(ind_id)
    try:
        added_terms = app.db.add_phenotype(ind_obj, phenotype_id)
        if added_terms is None:
            flash("Term with id {} was not found".format(phenotype_id),
                  'danger')
        elif added_terms == []:
            flash("Term with id {} was already added".format(phenotype_id),
                  'warning')
    except RuntimeError as error:
        return abort(500, error.message)

    return redirect(request.referrer)