caldav: when creating a calendar child, return a node
bzr revid: p_christ@hol.gr-20100812111028-tntn2b1uspc64cyd
This commit is contained in:
@@ -233,9 +233,21 @@ class node_calendar(nodes.node_class):
|
||||
Return the node_* created
|
||||
"""
|
||||
# we ignore the path, it will be re-generated automatically
|
||||
fil_obj = self.context._dirobj.pool.get('basic.calendar')
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
uid = self.context.uid
|
||||
|
||||
res = self.set_data(cr, data)
|
||||
|
||||
# TODO: use the res to create at least one node
|
||||
|
||||
if res and len(res):
|
||||
# We arbitrarily construct only the first node of the data
|
||||
# that have been imported. ICS may have had more elements,
|
||||
# but only one node can be returned here.
|
||||
assert isinstance(res[0], (int, long))
|
||||
fnodes = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self,
|
||||
domain=[('id','=',res[0])], context=ctx)
|
||||
return fnodes[0]
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user