Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
462ba6d5
Commit
462ba6d5
authored
May 11, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevented accidental transactions from the locking code.
parent
de18c80a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lib/python/webdav/Lockable.py
lib/python/webdav/Lockable.py
+8
-4
No files found.
lib/python/webdav/Lockable.py
View file @
462ba6d5
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
"$Revision: 1.
5
$"
[
11
:
-
2
]
__version__
=
"$Revision: 1.
6
$"
[
11
:
-
2
]
from
WriteLockInterface
import
WriteLockInterface
,
LockItemInterface
from
EtagSupport
import
EtagSupport
...
...
@@ -120,7 +120,7 @@ class LockableItem(EtagSupport):
security
.
setPermissionDefault
(
'WebDAV Unlock items'
,(
'Manager'
,
'Owner'
,))
def
wl_lockmapping
(
self
,
killinvalids
=
0
):
def
wl_lockmapping
(
self
,
killinvalids
=
0
,
create
=
0
):
""" if 'killinvalids' is 1, locks who are no longer valid
will be deleted """
...
...
@@ -128,7 +128,11 @@ class LockableItem(EtagSupport):
except
:
locks
=
None
if
locks
is
None
:
locks
=
self
.
_dav_writelocks
=
PersistentMapping
()
if
create
:
locks
=
self
.
_dav_writelocks
=
PersistentMapping
()
else
:
# Don't generate a side effect transaction.
locks
=
{}
return
locks
elif
killinvalids
:
# Delete invalid locks
...
...
@@ -165,7 +169,7 @@ class LockableItem(EtagSupport):
else
:
return
0
def
wl_setLock
(
self
,
locktoken
,
lock
):
locks
=
self
.
wl_lockmapping
()
locks
=
self
.
wl_lockmapping
(
create
=
1
)
if
LockItemInterface
.
isImplementedBy
(
lock
):
if
locktoken
==
lock
.
getLockToken
():
locks
[
locktoken
]
=
lock
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment