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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d9912da2
Commit
d9912da2
authored
Jun 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
4b270797
09f482ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/diff_note.rb
app/models/diff_note.rb
+1
-1
changelogs/unreleased/osw-avoid-500-on-suggestions-check.yml
changelogs/unreleased/osw-avoid-500-on-suggestions-check.yml
+5
-0
spec/models/diff_note_spec.rb
spec/models/diff_note_spec.rb
+8
-0
No files found.
app/models/diff_note.rb
View file @
d9912da2
...
...
@@ -77,7 +77,7 @@ class DiffNote < Note
end
def
supports_suggestion?
return
false
unless
noteable
.
supports_suggestion?
&&
on_text?
return
false
unless
noteable
&
.
supports_suggestion?
&&
on_text?
# We don't want to trigger side-effects of `diff_file` call.
return
false
unless
file
=
latest_diff_file
return
false
unless
line
=
file
.
line_for_position
(
self
.
position
)
...
...
changelogs/unreleased/osw-avoid-500-on-suggestions-check.yml
0 → 100644
View file @
d9912da2
---
title
:
Avoid 500 when rendering users ATOM data
merge_request
:
25408
author
:
type
:
fixed
spec/models/diff_note_spec.rb
View file @
d9912da2
...
...
@@ -321,6 +321,14 @@ describe DiffNote do
end
describe
'#supports_suggestion?'
do
context
'when noteable does not exist'
do
it
'returns false'
do
allow
(
subject
).
to
receive
(
:noteable
)
{
nil
}
expect
(
subject
.
supports_suggestion?
).
to
be
(
false
)
end
end
context
'when noteable does not support suggestions'
do
it
'returns false'
do
allow
(
subject
.
noteable
).
to
receive
(
:supports_suggestion?
)
{
false
}
...
...
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