diff options
| author | hukl <contact@smyck.org> | 2009-09-03 20:40:15 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-03 20:40:15 +0200 |
| commit | 50a03a184ca867ce0962b3a5980261b1912c8c26 (patch) | |
| tree | 1c5ba475e73dd88ee7a94d0428523ae4a909b9cd /app/controllers | |
| parent | d749383308a19b7c284ef199f715a2713bd5b7ca (diff) | |
more graceful handling of locked pages exceptions.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/nodes_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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 | |||
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | def edit | 45 | def edit |
| 46 | @draft = @node.find_or_create_draft( current_user ) | 46 | begin |
| 47 | @draft = @node.find_or_create_draft( current_user ) | ||
| 48 | rescue LockedByAnotherUser | ||
| 49 | flash[:error] = "Page is locked by another user who is working on it!" | ||
| 50 | redirect_to :back | ||
| 51 | end | ||
| 47 | end | 52 | end |
| 48 | 53 | ||
| 49 | def update | 54 | def update |
