diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-10-12 13:41:03 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-10-12 13:41:03 +0300 |
| commit | d697bd94e5a860d91ddf3f5ffaa94a4c6f9c5384 (patch) | |
| tree | 1ebec203161a7a56108f0888aa266d5d7dcf9542 /addons/document_webdav/webdav.py | |
| parent | 7bd29d41546d0253d136b4a95c075d40947d3b11 (diff) | |
Doc webdav, caldav: fix support for the calendar-multiget report
This report is a request to fetch multiple calendar entries. The
request contains a range of URIs to fetch, which must be processed
at the dav_fs.Report level.
The report is being called with Depth: 0 , for which the library could
not perform an iterator. Hack over it and explictly set Depth:1 in our
case.
bzr revid: p_christ@hol.gr-20101012104103-eu156146jy4a75af
Diffstat (limited to 'addons/document_webdav/webdav.py')
| -rw-r--r-- | addons/document_webdav/webdav.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 0a9f4cd1111..484a1054475 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -31,6 +31,7 @@ from osv import osv try: from DAV import utils from DAV.propfind import PROPFIND + from DAV.report import REPORT except ImportError: raise osv.except_osv('PyWebDAV Import Error!','Please install PyWebDAV \ from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/') @@ -257,3 +258,18 @@ def mk_propname_response(self,uri,propnames,doc): PROPFIND.mk_prop_response = mk_prop_response PROPFIND.mk_propname_response = mk_propname_response +super_create_prop = REPORT.create_prop + +def create_prop(self): + try: + if (self.filter is not None) and self._depth == "0": + hrefs = self.filter.getElementsByTagNameNS('DAV:', 'href') + if hrefs: + self._depth = "1" + except Exception: + pass + return super_create_prop(self) + +REPORT.create_prop = create_prop + +#eof |
