@@ -151,13 +151,7 class IssuesController < ApplicationController | |||
|
151 | 151 | return |
|
152 | 152 | else |
|
153 | 153 | respond_to do |format| |
|
154 | format.html { | |
|
155 | if @issue.project.nil? | |
|
156 | render_error :status => 422 | |
|
157 | else | |
|
158 | render :action => 'new' | |
|
159 | end | |
|
160 | } | |
|
154 | format.html { render :action => 'new' } | |
|
161 | 155 | format.api { render_validation_errors(@issue) } |
|
162 | 156 | end |
|
163 | 157 | end |
@@ -490,6 +484,9 class IssuesController < ApplicationController | |||
|
490 | 484 | render_error l(:error_no_default_issue_status) |
|
491 | 485 | return false |
|
492 | 486 | end |
|
487 | else | |
|
488 | render_error :message => l(:error_no_projects_with_tracker_allowed_for_new_issue), :status => 403 | |
|
489 | return false | |
|
493 | 490 | end |
|
494 | 491 | |
|
495 | 492 | @priorities = IssuePriority.active |
@@ -214,6 +214,7 en: | |||
|
214 | 214 | error_attachment_extension_not_allowed: "Attachment extension %{extension} is not allowed" |
|
215 | 215 | error_ldap_bind_credentials: "Invalid LDAP Account/Password" |
|
216 | 216 | error_no_tracker_allowed_for_new_issue_in_project: "The project doesn't have any trackers for which you can create an issue" |
|
217 | error_no_projects_with_tracker_allowed_for_new_issue: "There are no projects with trackers for which you can create an issue" | |
|
217 | 218 | |
|
218 | 219 | mail_subject_lost_password: "Your %{value} password" |
|
219 | 220 | mail_body_lost_password: 'To change your password, click on the following link:' |
@@ -234,6 +234,7 fr: | |||
|
234 | 234 | error_attachment_extension_not_allowed: "L'extension %{extension} n'est pas autorisée" |
|
235 | 235 | error_ldap_bind_credentials: "Identifiant ou mot de passe LDAP incorrect" |
|
236 | 236 | error_no_tracker_allowed_for_new_issue_in_project: "Le projet ne dispose d'aucun tracker sur lequel vous pouvez créer une demande" |
|
237 | error_no_projects_with_tracker_allowed_for_new_issue: "Aucun projet ne dispose d'un tracker sur lequel vous pouvez créer une demande" | |
|
237 | 238 | |
|
238 | 239 | mail_subject_lost_password: "Votre mot de passe %{value}" |
|
239 | 240 | mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :' |
@@ -1817,6 +1817,24 class IssuesControllerTest < Redmine::ControllerTest | |||
|
1817 | 1817 | assert_response 403 |
|
1818 | 1818 | end |
|
1819 | 1819 | |
|
1820 | def test_new_without_projects_should_respond_with_403 | |
|
1821 | Project.delete_all | |
|
1822 | @request.session[:user_id] = 2 | |
|
1823 | ||
|
1824 | get :new | |
|
1825 | assert_response 403 | |
|
1826 | assert_select_error /no projects/ | |
|
1827 | end | |
|
1828 | ||
|
1829 | def test_new_without_enabled_trackers_on_projects_should_respond_with_403 | |
|
1830 | Project.all.each {|p| p.trackers.clear } | |
|
1831 | @request.session[:user_id] = 2 | |
|
1832 | ||
|
1833 | get :new | |
|
1834 | assert_response 403 | |
|
1835 | assert_select_error /no projects/ | |
|
1836 | end | |
|
1837 | ||
|
1820 | 1838 | def test_new_should_preselect_default_version |
|
1821 | 1839 | version = Version.generate!(:project_id => 1) |
|
1822 | 1840 | Project.find(1).update_attribute :default_version_id, version.id |
@@ -2540,7 +2558,7 class IssuesControllerTest < Redmine::ControllerTest | |||
|
2540 | 2558 | :issue => {:project_id => 3, |
|
2541 | 2559 | :tracker_id => 2, |
|
2542 | 2560 | :subject => 'Foo'} |
|
2543 |
assert_response 4 |
|
|
2561 | assert_response 403 | |
|
2544 | 2562 | end |
|
2545 | 2563 | end |
|
2546 | 2564 |
General Comments 0
You need to be logged in to leave comments.
Login now