Commit 94b676fe authored by Maurits van Rees's avatar Maurits van Rees

Log a warning when making a partial copy.

parent e28dee95
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
from json import dumps from json import dumps
from json import loads from json import loads
import logging
import re import re
import tempfile import tempfile
import warnings import warnings
...@@ -56,7 +57,7 @@ class CopyError(Exception): ...@@ -56,7 +57,7 @@ class CopyError(Exception):
pass pass
copy_re = re.compile('^copy([0-9]*)_of_(.*)') copy_re = re.compile('^copy([0-9]*)_of_(.*)')
logger = logging.getLogger('OFS')
_marker = [] _marker = []
...@@ -551,6 +552,12 @@ class CopySource(Base): ...@@ -551,6 +552,12 @@ class CopySource(Base):
# We do not use cp._delObject, because this would fire # We do not use cp._delObject, because this would fire
# events that are needless for objects that are not even in # events that are needless for objects that are not even in
# an Acquisition chain yet. # 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) cp._delOb(k)
# We need to cleanup the internal objects list, even when # We need to cleanup the internal objects list, even when
# in some implementations this is always an empty tuple. # in some implementations this is always an empty tuple.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment