Skip to content
Snippets Groups Projects
Commit c2fee9e6 authored by Panos Christeas's avatar Panos Christeas
Browse files

caldav: when creating a calendar child, return a node

bzr revid: p_christ@hol.gr-20100812111028-tntn2b1uspc64cyd
parent bcba71f7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment