@@ -24,6 +24,7 class IssuesController < ApplicationController | |||
|
24 | 24 | before_filter :find_project, :only => [:new, :create, :update_form, :preview, :auto_complete] |
|
25 | 25 | before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu] |
|
26 | 26 | before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar] |
|
27 | before_filter :check_for_default_issue_status, :only => [:new, :create] | |
|
27 | 28 | before_filter :build_new_issue_from_params, :only => [:new, :create] |
|
28 | 29 | accept_key_auth :index, :show, :changes |
|
29 | 30 | |
@@ -557,10 +558,6 private | |||
|
557 | 558 | render_error l(:error_no_tracker_in_project) |
|
558 | 559 | return false |
|
559 | 560 | end |
|
560 | if @issue.status.nil? | |
|
561 | render_error l(:error_no_default_issue_status) | |
|
562 | return false | |
|
563 | end | |
|
564 | 561 | if params[:issue].is_a?(Hash) |
|
565 | 562 | @issue.safe_attributes = params[:issue] |
|
566 | 563 | @issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project) |
@@ -581,4 +578,11 private | |||
|
581 | 578 | :ids => '#' + unsaved_issue_ids.join(', #')) |
|
582 | 579 | end |
|
583 | 580 | end |
|
581 | ||
|
582 | def check_for_default_issue_status | |
|
583 | if IssueStatus.default.nil? | |
|
584 | render_error l(:error_no_default_issue_status) | |
|
585 | return false | |
|
586 | end | |
|
587 | end | |
|
584 | 588 | end |
General Comments 0
You need to be logged in to leave comments.
Login now