From 0b1b20f11e4390b98f993d86c1644214a1f0c5a7 Mon Sep 17 00:00:00 2001 From: Burathar Date: Tue, 23 Mar 2021 22:51:41 +0100 Subject: [PATCH] Use url variable instead of name --- biscd/biscd/routes.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/biscd/biscd/routes.py b/biscd/biscd/routes.py index fea342d..f287563 100644 --- a/biscd/biscd/routes.py +++ b/biscd/biscd/routes.py @@ -51,11 +51,8 @@ def register(): return render_template('register.html', title='Register', form=form) -@app.route('/project/', methods=['GET', 'POST']) +@app.route('/project/', methods=['GET', 'POST']) @login_required -def project_dashboard(project_name): - print(project_name) - project = Project.get(name=project_name) - if project is None: - abort(404) +def project_dashboard(project_url): + project = Project.first_or_404(url=project_url) return render_template('project.html', project=project)