Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
c64cd113
Commit
c64cd113
authored
May 21, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ! for verify_record! because it could raise
parent
75415663
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
lib/gitlab/email/handler/base_handler.rb
lib/gitlab/email/handler/base_handler.rb
+1
-1
lib/gitlab/email/handler/create_issue_handler.rb
lib/gitlab/email/handler/create_issue_handler.rb
+1
-1
lib/gitlab/email/handler/create_note_handler.rb
lib/gitlab/email/handler/create_note_handler.rb
+1
-1
No files found.
lib/gitlab/email/handler/base_handler.rb
View file @
c64cd113
...
...
@@ -42,7 +42,7 @@ module Gitlab
end
.
join
end
def
verify_record
(
record
,
exception
,
error_title
)
def
verify_record
!
(
record
,
exception
,
error_title
)
return
if
record
.
persisted?
msg
=
error_title
+
record
.
errors
.
full_messages
.
map
do
|
error
|
...
...
lib/gitlab/email/handler/create_issue_handler.rb
View file @
c64cd113
...
...
@@ -12,7 +12,7 @@ module Gitlab
def
execute
validate_permission!
(
:create_issue
)
verify_record
(
verify_record
!
(
create_issue
,
InvalidIssueError
,
"The issue could not be created for the following reasons:"
...
...
lib/gitlab/email/handler/create_note_handler.rb
View file @
c64cd113
...
...
@@ -18,7 +18,7 @@ module Gitlab
raise
NoteableNotFoundError
unless
sent_notification
.
noteable
raise
EmptyEmailError
if
message
.
blank?
verify_record
(
verify_record
!
(
create_note
,
InvalidNoteError
,
"The comment could not be created for the following reasons:"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment