Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rating_api/routes/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
ObjectNotFound,
TooManyCommentRequests,
TooManyCommentsToLecturer,
UpdateError,
)
from rating_api.models import Comment, CommentReaction, Lecturer, LecturerUserComment, Reaction, ReviewStatus
from rating_api.schemas.base import StatusResponseModel
Expand Down Expand Up @@ -309,7 +308,7 @@ async def delete_comment(
has_delete_scope = "rating.comment.delete" in [scope['name'] for scope in user.get('session_scopes')]

# Если нет привилегии - проверяем права обычного пользователя
if not has_delete_scope and (comment.is_anonymous or comment.user_id != user.get('id')):
if not has_delete_scope and (comment.user_id == None or comment.user_id != user.get('id')):
raise ForbiddenAction(Comment)
Comment.delete(session=db.session, id=uuid)

Expand Down