Commit 52795ab4 by Őry Máté

vm: add Node.disable(base_activity)

parent db51287a
......@@ -90,10 +90,14 @@ class Node(TimeStampedModel):
return 'OFFLINE'
def disable(self, user=None):
def disable(self, user=None, base_activity=None):
''' Disable the node.'''
if self.enabled:
with node_activity(code_suffix='disable', node=self, user=user):
if base_activity:
act_ctx = base_activity.sub_activity('disable')
act_ctx = node_activity('disable', node=self, user=user)
with act_ctx:
self.enabled = False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment