summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/nodes_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index f773c6a..1796090 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -78,9 +78,8 @@ class NodesController < ApplicationController
78 def unlock 78 def unlock
79 # TODO that actually has to be implemented in the model, once we have 79 # TODO that actually has to be implemented in the model, once we have
80 # permissions 80 # permissions
81 if draft = @node.draft 81 if @node.user
82 draft.user = nil 82 @node.unlock!
83 draft.save
84 flash[:notice] = "Node unlocked" 83 flash[:notice] = "Node unlocked"
85 else 84 else
86 flash[:notice] = "Cannot unlock" 85 flash[:notice] = "Cannot unlock"