summaryrefslogtreecommitdiffstats
path: root/app/controllers/issue_statuses_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-22 22:04:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-22 22:04:07 +0000
commit68f3e91bd7030c7ac0a33bb0bfa36b30a3645d32 (patch)
tree8ce266a8db5e8be17e8013db3f1098354d4b9d9a /app/controllers/issue_statuses_controller.rb
parent35e8f0d25d97622034dcebcec0524ceff708bf12 (diff)
downloadredmine-68f3e91bd7030c7ac0a33bb0bfa36b30a3645d32.tar.gz
redmine-68f3e91bd7030c7ac0a33bb0bfa36b30a3645d32.zip
Resourcified issue statuses.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7890 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_statuses_controller.rb')
-rw-r--r--app/controllers/issue_statuses_controller.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb
index 1f747a4f3..8364074d4 100644
--- a/app/controllers/issue_statuses_controller.rb
+++ b/app/controllers/issue_statuses_controller.rb
@@ -22,9 +22,6 @@ class IssueStatusesController < ApplicationController
before_filter :require_admin_or_api_request, :only => :index
accept_api_auth :index
- verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_issue_done_ratio ],
- :redirect_to => { :action => :index }
-
def index
respond_to do |format|
format.html {
@@ -43,7 +40,7 @@ class IssueStatusesController < ApplicationController
def create
@issue_status = IssueStatus.new(params[:issue_status])
- if @issue_status.save
+ if request.post? && @issue_status.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index'
else
@@ -57,7 +54,7 @@ class IssueStatusesController < ApplicationController
def update
@issue_status = IssueStatus.find(params[:id])
- if @issue_status.update_attributes(params[:issue_status])
+ if request.put? && @issue_status.update_attributes(params[:issue_status])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
else
@@ -65,6 +62,7 @@ class IssueStatusesController < ApplicationController
end
end
+ verify :method => :delete, :only => :destroy, :redirect_to => { :action => :index }
def destroy
IssueStatus.find(params[:id]).destroy
redirect_to :action => 'index'
@@ -74,7 +72,7 @@ class IssueStatusesController < ApplicationController
end
def update_issue_done_ratio
- if IssueStatus.update_issue_done_ratios
+ if request.post? && IssueStatus.update_issue_done_ratios
flash[:notice] = l(:notice_issue_done_ratios_updated)
else
flash[:error] = l(:error_issue_done_ratios_not_updated)