@home.route('/edit/<page>')
def edit(page: str=None):
    '\n    The edit page allows for direct editing of a top-level element such as\n    title, abstract, creators, etc. This function simply redirects to the\n    specified page, passing the packageid as the only parameter.\n    '
    if (current_user.is_authenticated and page):
        current_filename = user_data.get_active_document()
        if current_filename:
            eml_node = load_eml(filename=current_filename)
            new_page = (page if eml_node else PAGE_FILE_ERROR)
            return redirect(url_for(new_page, filename=current_filename))
    return render_template('index.html')
The edit page allows for direct editing of a top-level element such as
title, abstract, creators, etc. This function simply redirects to the
specified page, passing the packageid as the only parameter.
@home.route('/edit/<page>')
def edit(page: str=None):
    '\n    The edit page allows for direct editing of a top-level element such as\n    title, abstract, creators, etc. This function simply redirects to the\n    specified page, passing the packageid as the only parameter.\n    '
    if (current_user.is_authenticated and page):
        current_filename = user_data.get_active_document()
        if current_filename:
            eml_node = load_eml(filename=current_filename)
            new_page = (page if eml_node else PAGE_FILE_ERROR)
            return redirect(url_for(new_page, filename=current_filename))
    return render_template('index.html')