]> source.dussan.org Git - redmine.git/commitdiff
Added an error message when trying to create an issue with no default status defined.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Jun 2007 22:31:05 +0000 (22:31 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Jun 2007 22:31:05 +0000 (22:31 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@560 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb

index ead1a224a23c0ff1b145ad008b69b72bca17d3c3..233d012d2aa02f1463c889b7e9bed1d0a2b282c2 100644 (file)
@@ -231,6 +231,11 @@ class ProjectsController < ApplicationController
     @priorities = Enumeration::get_values('IPRI')
     
     default_status = IssueStatus.default
+    unless default_status
+      flash.now[:notice] = 'No default issue status defined. Please check your configuration.'
+      render :nothing => true, :layout => true
+      return
+    end
     @issue = Issue.new(:project => @project, :tracker => @tracker)    
     @issue.status = default_status
     @allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker))if logged_in_user