Skip to content

Commit

Permalink
Log a warning when making a partial copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Dec 21, 2016
1 parent f58a296 commit 8c85cda
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/OFS/CopySupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from cgi import escape
from marshal import dumps
from marshal import loads
import logging
import re
import sys
import tempfile
Expand Down Expand Up @@ -61,8 +62,8 @@ class CopyError(Exception):
pass

copy_re = re.compile('^copy([0-9]*)_of_(.*)')

_marker=[]
logger = logging.getLogger('OFS')
_marker = []


class CopyContainer(Base):
Expand Down Expand Up @@ -607,6 +608,12 @@ def _cleanupCopy(self, cp):
# We do not use cp._delObject, because this would fire
# events that are needless for objects that are not even in
# an Acquisition chain yet.
logger.warn(
'While copying %s, removed %s from copy '
'because user is not allowed to view the original.',
'/'.join(self.getPhysicalPath()),
'/'.join(v.getPhysicalPath())
)
cp._delOb(k)
# We need to cleanup the internal objects list, even when
# in some implementations this is always an empty tuple.
Expand Down

0 comments on commit 8c85cda

Please sign in to comment.