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
00afb318
Commit
00afb318
authored
Aug 03, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a check to prevent deleting a version while the user is *in* the
version.
parent
2ca037b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+19
-5
No files found.
lib/python/Products/OFSP/Version.py
View file @
00afb318
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
##############################################################################
##############################################################################
"""Version object"""
"""Version object"""
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
Globals
,
time
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
from
AccessControl.Role
import
RoleManager
...
@@ -162,7 +162,6 @@ class Version(Persistent,Implicit,RoleManager,Item):
...
@@ -162,7 +162,6 @@ class Version(Persistent,Implicit,RoleManager,Item):
"""Begin working in a version"""
"""Begin working in a version"""
RESPONSE
.
setCookie
(
RESPONSE
.
setCookie
(
Globals
.
VersionNameName
,
self
.
cookie
,
Globals
.
VersionNameName
,
self
.
cookie
,
#expires="Mon, 27-Dec-99 23:59:59 GMT",
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
...
@@ -180,7 +179,7 @@ class Version(Persistent,Implicit,RoleManager,Item):
...
@@ -180,7 +179,7 @@ class Version(Persistent,Implicit,RoleManager,Item):
"""Temporarily stop working in a version"""
"""Temporarily stop working in a version"""
RESPONSE
.
setCookie
(
RESPONSE
.
setCookie
(
Globals
.
VersionNameName
,
'No longer active'
,
Globals
.
VersionNameName
,
'No longer active'
,
expires
=
"Mon, 2
7-Aug-84
23:59:59 GMT"
,
expires
=
"Mon, 2
5-Jan-1999
23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
...
@@ -251,4 +250,19 @@ class Version(Persistent,Implicit,RoleManager,Item):
...
@@ -251,4 +250,19 @@ class Version(Persistent,Implicit,RoleManager,Item):
'Attempt to %sdelete a non-empty version.<p>'
'Attempt to %sdelete a non-empty version.<p>'
((
self
is
not
item
)
and
'indirectly '
or
''
))
((
self
is
not
item
)
and
'indirectly '
or
''
))
try
:
REQUEST
=
self
.
REQUEST
except
:
pass
else
:
v
=
self
.
cookie
if
REQUEST
.
get
(
Globals
.
VersionNameName
,
''
)
==
v
:
raise
'Version error'
,
(
'An attempt was made to delete a version, %s, or an
\
n
'
'object containing %s while
\
n
working in the
\
n
'
'version %s. This would lead to a "version
\
n
'
'paradox". The object containing the deleted
\
n
'
'object would be locked and it would be impossible
\
n
'
'to clear the lock by saving or discarding the
\
n
'
'version, because the version would no longer
\
n
'
'be accessable.<p>
\
n
'
%
(
v
,
v
,
v
))
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