diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/main.py | 24 | 
1 files changed, 4 insertions, 20 deletions
| diff --git a/app/main.py b/app/main.py index 149ef64..fd1a8a0 100644 --- a/app/main.py +++ b/app/main.py @@ -1,22 +1,6 @@  # -*- mode: python; -*-  """ -routes.py module ----------------- - -This Python module contains the logic supporting: -1. Navigating between website pages -2. Interpreting user requests to the server -3. Dispatching requested content back to the user - -Python dependencies: -- flask: provides web application features -- forms: provides secure user form submission -- sqlalchemy: provides communication with database on server. - -Personal imports: -These are used to avoid cluttering this file with -placeholder data for posts' content.  """  import os @@ -104,9 +88,9 @@ def download_remote():              db.session.add(new_download)              db.session.commit()              flash(f"Successfully started downloading {title}.") -        return redirect("/index") +        return redirect(url_for("main.home"))      flash(f"Couldn't download {title}.") -    return redirect("/index") +    return redirect(url_for("main.home"))  @main.route("/manage-remote/", methods=["POST"]) @@ -126,7 +110,7 @@ def manage_remote():          elif form.remove_remote.data:              return redirect(url_for("main.remove_remote", file=file_name))          flash("Couldn't manage remote file.", "error") -    return redirect("/index") +    return redirect(url_for("main.home"))  @main.route("/download-local/<file>", methods=["GET", "POST"]) @@ -144,4 +128,4 @@ def remove_remote(file):      file_to_remove = os.path.join(os.getcwd(), "downloads", file)      os.remove(file_to_remove)      flash(f"Successfully removed file {file}.") -    return redirect("/index") +    return redirect(url_for("main.home")) | 
