Skip to content

Commit

Permalink
- alternative fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Nov 23, 2019
1 parent 31e3bdb commit bf05a0e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
3.0.9 (unreleased)
------------------

- fix ImportError under Zope 5 due to moved dependencies
(`#19 <https://github.com/zopefoundation/Products.ZSQLMethods/pull/19>`_)


3.0.8 (2019-08-05)
------------------
Expand Down
27 changes: 27 additions & 0 deletions src/Shared/DC/ZRDB/DA.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@
from .sqlvar import SQLVar


try:
from OFS import bbb
except ImportError:
bbb = None


if bbb is not None and bbb.HAS_ZSERVER:
from webdav.Resource import Resource
from webdav.Lockable import ResourceLockedError
else:
from zExceptions import ResourceLockedError

class Resource:
def dav__init(self, request, response):
pass

def dav__validate(self, object, methodname, REQUEST):
pass

def dav__simpleifhandler(self, request, response, method='PUT',
col=0, url=None, refresh=0):
pass


def _getPath(home, prefix, name, suffixes):

dir = os.path.join(home, prefix)
Expand Down Expand Up @@ -294,6 +318,9 @@ def manage_edit(self, title, connection_id, arguments, template,
return self._er(title, connection_id, arguments, template,
SUBMIT, dtpref_cols, dtpref_rows, REQUEST)

if self.wl_isLocked():
raise ResourceLockedError('SQL Method is locked via WebDAV')

self.title = str(title)
self.connection_id = str(connection_id)
arguments = str(arguments)
Expand Down

0 comments on commit bf05a0e

Please sign in to comment.