mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 22:47:36 +01:00
Use .get() instead of filter_by() for primary key queries
This commit is contained in:
parent
536da2add2
commit
821832770c
@ -283,7 +283,7 @@ def create_editrequest_page(ptype, author, name):
|
|||||||
def view_editrequest_page(ptype, author, name, id):
|
def view_editrequest_page(ptype, author, name, id):
|
||||||
package = getPageByInfo(ptype, author, name)
|
package = getPageByInfo(ptype, author, name)
|
||||||
|
|
||||||
erequest = EditRequest.query.filter_by(id=id).first()
|
erequest = EditRequest.query.get(id)
|
||||||
if erequest is None:
|
if erequest is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ def approve_editrequest_page(ptype, author, name, id):
|
|||||||
flash("You don't have permission to do that.", "error")
|
flash("You don't have permission to do that.", "error")
|
||||||
return redirect(package.getDetailsURL())
|
return redirect(package.getDetailsURL())
|
||||||
|
|
||||||
erequest = EditRequest.query.filter_by(id=id).first()
|
erequest = EditRequest.query.get(id)
|
||||||
if erequest is None:
|
if erequest is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ def reject_editrequest_page(ptype, author, name, id):
|
|||||||
flash("You don't have permission to do that.", "error")
|
flash("You don't have permission to do that.", "error")
|
||||||
return redirect(package.getDetailsURL())
|
return redirect(package.getDetailsURL())
|
||||||
|
|
||||||
erequest = EditRequest.query.filter_by(id=id).first()
|
erequest = EditRequest.query.get(id)
|
||||||
if erequest is None:
|
if erequest is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ def edit_release_page(type, author, name, id):
|
|||||||
if user is None:
|
if user is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
release = PackageRelease.query.filter_by(id=id).first()
|
release = PackageRelease.query.get(id)
|
||||||
if release is None:
|
if release is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user