summaryrefslogtreecommitdiff
path: root/app/main.py
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2022-07-24 16:04:36 +0200
committerMarius Peter <marius.peter@tutanota.com>2022-07-24 16:04:36 +0200
commitc355c31f72b5658f1d3b37c60c137a8275e964ca (patch)
tree563d5c50d887cfaf571a75df2e35af7faf4283f6 /app/main.py
parent648ae3082e7491ad2e3017be43f0b0dafc36202f (diff)
Main app.
Diffstat (limited to 'app/main.py')
-rw-r--r--app/main.py24
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"))
Copyright 2019--2024 Marius PETER