]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup, removed conditions on request method.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Nov 2014 20:32:11 +0000 (20:32 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Nov 2014 20:32:11 +0000 (20:32 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13538 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb

index 0a6b487a830029d6e405d3c9cee5044cbfdcc6e8..8f5e3697badea71b3a33469b20ce65801ddb1eca 100644 (file)
@@ -206,16 +206,16 @@ class ProjectsController < ApplicationController
   end
 
   def archive
-    if request.post?
-      unless @project.archive
-        flash[:error] = l(:error_can_not_archive_project)
-      end
+    unless @project.archive
+      flash[:error] = l(:error_can_not_archive_project)
     end
     redirect_to admin_projects_path(:status => params[:status])
   end
 
   def unarchive
-    @project.unarchive if request.post? && !@project.active?
+    unless @project.active?
+      @project.unarchive
+    end
     redirect_to admin_projects_path(:status => params[:status])
   end