]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix url_for crash on "home_page" v1.19.0
authorrubenwardy <rw@rubenwardy.com>
Thu, 21 Nov 2019 19:38:26 +0000 (19:38 +0000)
committerrubenwardy <rw@rubenwardy.com>
Thu, 21 Nov 2019 19:38:32 +0000 (19:38 +0000)
.dockerignore [new file with mode: 0644]
app/blueprints/homepage/__init__.py
app/blueprints/threads/__init__.py
app/blueprints/users/githublogin.py
app/blueprints/users/profile.py
app/templates/users/set_password.html

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..db3fdd0
--- /dev/null
@@ -0,0 +1,3 @@
+.git
+data
+uploads
index 0d50bbd1e0141a67ab591de3254d0957d4c65e9d..76dbb92eed7987cca543d92217d0f23bda9bbaa0 100644 (file)
@@ -8,7 +8,7 @@ from sqlalchemy.sql.expression import func
 
 @bp.route("/")
 @menu.register_menu(bp, ".", "Home")
-def home_page():
+def home():
        query   = Package.query.filter_by(approved=True, soft_deleted=False)
        count   = query.count()
        new     = query.order_by(db.desc(Package.created_at)).limit(8).all()
index 0eee201aa228ac4a26851dcb7a583139f54969b3..73d64c2dee2372dfe47e7b59e94798e1990073a4 100644 (file)
@@ -87,7 +87,7 @@ def view(id):
                        if package:
                                return redirect(package.getDetailsURL())
                        else:
-                               return redirect(url_for("home_page"))
+                               return redirect(url_for("homepage.home"))
 
                if len(comment) <= 500 and len(comment) > 3:
                        reply = ThreadReply()
@@ -150,7 +150,7 @@ def new():
        # Check that user can make the thread
        if not package.checkPerm(current_user, Permission.CREATE_THREAD):
                flash("Unable to create thread!", "error")
-               return redirect(url_for("home_page"))
+               return redirect(url_for("homepage.home"))
 
        # Only allow creating one thread when not approved
        elif is_review_thread and package.review_thread is not None:
@@ -163,7 +163,7 @@ def new():
                if package:
                        return redirect(package.getDetailsURL())
                else:
-                       return redirect(url_for("home_page"))
+                       return redirect(url_for("homepage.home"))
 
        # Set default values
        elif request.method == "GET":
index 458c637a1f21554e1b21215a7615ffeaa8b7fed5..56c44128f69b655cc49456d87d166b785eaa3fea 100644 (file)
@@ -54,10 +54,10 @@ def github_authorized(oauth_token):
                        current_user.github_username = username
                        db.session.commit()
                        flash("Linked github to account", "success")
-                       return redirect(url_for("home_page"))
+                       return redirect(url_for("homepage.home"))
                else:
                        flash("Github account is already associated with another user", "danger")
-                       return redirect(url_for("home_page"))
+                       return redirect(url_for("homepage.home"))
 
        # If not logged in, log in
        else:
@@ -68,7 +68,7 @@ def github_authorized(oauth_token):
                        if current_user.password is None:
                                return redirect(next_url or url_for("users.set_password", optional=True))
                        else:
-                               return redirect(next_url or url_for("home_page"))
+                               return redirect(next_url or url_for("homepage.home"))
                else:
                        flash("Authorization failed [err=gh-login-failed]", "danger")
                        return redirect(url_for("user.login"))
index a3c592c32132c5e0c16560a3712d6cec8f9fb60c..8e6bfe945f69bf97d00ac35b5546026016058309 100644 (file)
@@ -306,4 +306,4 @@ def verify_email():
        if current_user.is_authenticated:
                return redirect(url_for("users.profile", username=current_user.username))
        else:
-               return redirect(url_for("home_page"))
+               return redirect(url_for("homepage.home"))
index 3fb7b26b1e48a66b18583dee5dea3bae33127c9f..2d520212d9b24e958cae465be8ef2f4cd501c41f 100644 (file)
@@ -10,7 +10,7 @@
        <div class="alert alert-primary">
                It is recommended that you set a password for your account.
 
-               <a class="alert_right button" href="{{ url_for('home_page') }}">Skip</a>
+               <a class="alert_right button" href="{{ url_for('homepage.home') }}">Skip</a>
        </div>
 {% endif %}