mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 09:33:44 +01:00
Fix crash when guests view package page
This commit is contained in:
parent
849b814034
commit
db80c441ec
@ -158,7 +158,7 @@ def view(package):
|
|||||||
elif not current_user.rank.atLeast(UserRank.EDITOR) and not current_user == package.author:
|
elif not current_user.rank.atLeast(UserRank.EDITOR) and not current_user == package.author:
|
||||||
threads = threads.filter(or_(Thread.private == False, Thread.author == current_user))
|
threads = threads.filter(or_(Thread.private == False, Thread.author == current_user))
|
||||||
|
|
||||||
has_review = PackageReview.query.filter_by(package=package, author=current_user).count() > 0
|
has_review = current_user.is_authenticated and PackageReview.query.filter_by(package=package, author=current_user).count() > 0
|
||||||
|
|
||||||
return render_template("packages/view.html", \
|
return render_template("packages/view.html", \
|
||||||
package=package, releases=releases, requests=requests, \
|
package=package, releases=releases, requests=requests, \
|
||||||
|
Loading…
Reference in New Issue
Block a user