From 50a03a184ca867ce0962b3a5980261b1912c8c26 Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 3 Sep 2009 20:40:15 +0200 Subject: more graceful handling of locked pages exceptions. --- app/controllers/nodes_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/controllers/nodes_controller.rb') diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 09d0c52..07bbbac 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -43,7 +43,12 @@ class NodesController < ApplicationController end def edit - @draft = @node.find_or_create_draft( current_user ) + begin + @draft = @node.find_or_create_draft( current_user ) + rescue LockedByAnotherUser + flash[:error] = "Page is locked by another user who is working on it!" + redirect_to :back + end end def update -- cgit v1.3