@home.route('/download_current', methods=['GET', 'POST'])
@login_required
def download_current():
    current_document = user_data.get_active_document()
    if current_document:
        eml_node = load_eml(filename=current_document)
        save_both_formats(filename=current_document, eml_node=eml_node)
        return_value = user_data.download_eml(filename=current_document)
        if isinstance(return_value, str):
            flash(return_value)
        else:
            return return_value
@home.route('/download_current', methods=['GET', 'POST'])
@login_required
def download_current():
    current_document = user_data.get_active_document()
    if current_document:
        eml_node = load_eml(filename=current_document)
        save_both_formats(filename=current_document, eml_node=eml_node)
        return_value = user_data.download_eml(filename=current_document)
        if isinstance(return_value, str):
            flash(return_value)
        else:
            return return_value