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
4b675f24
Commit
4b675f24
authored
Jun 09, 2000
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made exceptions subclass BeforeDeleteException so that they can properly abort a deletion.
parent
48a7df57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+8
-4
No files found.
lib/python/Products/OFSP/Version.py
View file @
4b675f24
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Version object"""
__version__
=
'$Revision: 1.
39
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
40
$'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
...
...
@@ -92,9 +92,12 @@ from Globals import MessageDialog
from
Globals
import
Persistent
from
Acquisition
import
Implicit
from
OFS.SimpleItem
import
Item
from
string
import
rfind
from
string
import
rfind
,
join
from
Globals
import
HTML
from
App.Dialogs
import
MessageDialog
from
OFS.ObjectManager
import
BeforeDeleteException
class
VersionException
(
BeforeDeleteException
):
pass
manage_addVersionForm
=
Globals
.
HTMLFile
(
'versionAdd'
,
globals
())
...
...
@@ -249,11 +252,12 @@ class Version(Persistent,Implicit,RoleManager,Item):
def
manage_afterAdd
(
self
,
item
,
container
):
if
not
self
.
cookie
:
# Site-relative, quoted
self
.
cookie
=
self
.
absolute_url
(
1
)
def
manage_beforeDelete
(
self
,
item
,
container
):
if
self
.
nonempty
():
raise
'Version Error'
,
(
raise
VersionException
(
'Attempt to %sdelete a non-empty version.<p>'
((
self
is
not
item
)
and
'indirectly '
or
''
))
...
...
@@ -262,7 +266,7 @@ class Version(Persistent,Implicit,RoleManager,Item):
else
:
v
=
self
.
cookie
if
REQUEST
.
get
(
Globals
.
VersionNameName
,
''
)
==
v
:
raise
'Version error'
,
(
raise
VersionException
(
'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
'
...
...
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