mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix crash on unauthenticated user
This commit is contained in:
parent
383f9a43ef
commit
886dec3ffd
@ -398,7 +398,7 @@ def user_comments(username):
|
|||||||
# Filter replies the current user can see
|
# Filter replies the current user can see
|
||||||
query = ThreadReply.query.options(selectinload(ThreadReply.thread)).filter_by(author=user)
|
query = ThreadReply.query.options(selectinload(ThreadReply.thread)).filter_by(author=user)
|
||||||
if current_user != user and not (current_user.is_authenticated and current_user.rank.at_least(UserRank.APPROVER)):
|
if current_user != user and not (current_user.is_authenticated and current_user.rank.at_least(UserRank.APPROVER)):
|
||||||
if user.username == "ContentDB":
|
if user.username == "ContentDB" or not current_user.is_authenticated:
|
||||||
# The ContentDB user simply has too many comments, don't bother checking more than thread privacy
|
# The ContentDB user simply has too many comments, don't bother checking more than thread privacy
|
||||||
query = query.filter(ThreadReply.thread.has(private=False))
|
query = query.filter(ThreadReply.thread.has(private=False))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user