summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-12 15:59:50 +0200
committerAlon Levy <alon@pobox.com>2015-01-12 16:01:52 +0200
commitaa215e6e7c6c129acfc5ad9c5fb6140d15dfed84 (patch)
tree38a79626eaa6846637971a83d89d3df600bb5ba3
parent354fc3b12f167e053f472351dd7281d8f03b9aac (diff)
server/db_op: fix DBO_diff_commit__attr for name write
Since we used delete on the __attr_write key value dictionary, the return value we cached was missing the name attribute, causing the client not to see it. Fix it with a deepcopy.
-rw-r--r--src/server/db_op.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/db_op.py b/src/server/db_op.py
index e5a37f0d..66af843f 100644
--- a/src/server/db_op.py
+++ b/src/server/db_op.py
@@ -2,6 +2,7 @@ from collections import namedtuple
import hashlib
import json
import re
+from copy import deepcopy
from model.graph import Attr_Diff
from model.graph import Topo_Diff
@@ -330,7 +331,7 @@ class DBO_diff_commit__attr(DB_op):
def __init__(self, attr_diff):
super(DBO_diff_commit__attr, self).__init__()
- self.op_return_value__attr_diff = attr_diff # cache attr_diff as return value on success
+ self.op_return_value__attr_diff = deepcopy(attr_diff) # cache copy as return value on success
for id_attr, n_attr_diff in attr_diff.type__node.items():
# TODO parameterize multiple attr removal