No need to check project because:

sent_notification.project would never be nil, and
we also have already checked message_project before
entering process_create_issue.
This commit is contained in:
Lin Jen-Shin 2016-03-31 22:30:36 +08:00
parent 034e752aa4
commit 68b5ded056
1 changed files with 1 additions and 2 deletions

View File

@ -79,8 +79,7 @@ module Gitlab
raise UserNotFoundError unless author
raise UserBlockedError if author.blocked?
# TODO: Give project not found error if author cannot read project
raise UserNotAuthorizedError if project.nil? ||
!author.can?(permission, project)
raise UserNotAuthorizedError unless author.can?(permission, project)
end
# Find the first matched user in database from email From: section