@home.route('/save', methods=['GET', 'POST'])
@login_required
def save():
    current_document = current_user.get_filename()
    if (not current_document):
        flash('No document currently open')
        return render_template('index.html')
    eml_node = load_eml(filename=current_document)
    if (not eml_node):
        flash(f'Unable to open {current_document}')
        return render_template('index.html')
    save_both_formats(filename=current_document, eml_node=eml_node)
    flash(f'Saved {current_document}')
    return redirect(url_for(PAGE_TITLE, filename=current_document))
@home.route('/save', methods=['GET', 'POST'])
@login_required
def save():
    current_document = current_user.get_filename()
    if (not current_document):
        flash('No document currently open')
        return render_template('index.html')
    eml_node = load_eml(filename=current_document)
    if (not eml_node):
        flash(f'Unable to open {current_document}')
        return render_template('index.html')
    save_both_formats(filename=current_document, eml_node=eml_node)
    flash(f'Saved {current_document}')
    return redirect(url_for(PAGE_TITLE, filename=current_document))