From fa35025ec143e9dd3fcb8e8a21e32de62b6e82d2 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 24 May 2018 01:19:26 +0100 Subject: [PATCH] Fix 404 on new package --- app/views/packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/packages.py b/app/views/packages.py index 2c710b01..3a5de3a7 100644 --- a/app/views/packages.py +++ b/app/views/packages.py @@ -168,7 +168,7 @@ def create_edit_package_page(author=None, name=None): if request.method == "POST" and form.validate(): wasNew = False if not package: - package = getPackageByInfo(author.username, form["name"].data) + package = Package.query.filter_by(name=form["name"].data, author_id=author.id).first() if package is not None: flash("Package already exists!", "error") return redirect(url_for("create_edit_package_page"))