Commit 52795ab4 by Őry Máté

vm: add Node.disable(base_activity)

parent db51287a
...@@ -90,10 +90,14 @@ class Node(TimeStampedModel): ...@@ -90,10 +90,14 @@ class Node(TimeStampedModel):
else: else:
return 'OFFLINE' return 'OFFLINE'
def disable(self, user=None): def disable(self, user=None, base_activity=None):
''' Disable the node.''' ''' Disable the node.'''
if self.enabled: if self.enabled:
with node_activity(code_suffix='disable', node=self, user=user): if base_activity:
act_ctx = base_activity.sub_activity('disable')
else:
act_ctx = node_activity('disable', node=self, user=user)
with act_ctx:
self.enabled = False self.enabled = False
self.save() self.save()
......
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