mirror of
https://github.com/redmine/redmine.git
synced 2024-08-06 09:06:37 +02:00
Don't render the issue form if issue.project is nil (#19276).
git-svn-id: http://svn.redmine.org/redmine/trunk@14146 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
98c28b467b
commit
ea099fb771
@ -151,7 +151,13 @@ class IssuesController < ApplicationController
|
||||
return
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { render :action => 'new' }
|
||||
format.html {
|
||||
if @issue.project.nil?
|
||||
render_error :status => 422
|
||||
else
|
||||
render :action => 'new'
|
||||
end
|
||||
}
|
||||
format.api { render_validation_errors(@issue) }
|
||||
end
|
||||
end
|
||||
|
@ -2218,7 +2218,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
:issue => {:project_id => 3,
|
||||
:tracker_id => 2,
|
||||
:subject => 'Foo'}
|
||||
assert_response 403
|
||||
assert_response 422
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user