Skip to content

Commit

Permalink
Remove space for path and id during upload to Plone.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanteoh committed Oct 18, 2012
1 parent 55df0be commit f7d292a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion transmogrify/ploneremote/remoteconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __iter__(self):
continue

path = path.encode('ascii')
path = self.removeInvalidChar(path)
parentpath = '/'.join(path.split('/')[:-1])
parenturl = urllib.basejoin(self.target, parentpath.lstrip('/'))
parent = xmlrpclib.ServerProxy(parenturl)
Expand All @@ -89,6 +90,7 @@ def __iter__(self):
orig_path = item.get(self.pathkey(*keys)[0])

# oldpath is where item is now on the remote
orig_path = self.removeInvalidChar(orig_path)
redir = self.checkRedir(orig_path)
if redir is None:
oldpath = targetpath+orig_path
Expand Down Expand Up @@ -241,4 +243,8 @@ def checkType(self, path):
# Doesn't already exist
#self.logger.error("%s raised %s"%(path,e))
existingtype = None
return existingtype
return existingtype

def removeInvalidChar(self, path):
""" plone id does not like space during creating. So remove it. """
return path.replace(" ", "")

0 comments on commit f7d292a

Please sign in to comment.