Eliminate orgUnitPath encoding (#1527)

This commit is contained in:
Ross Scroggs
2022-05-31 08:24:37 -07:00
committed by GitHub
parent 3a41b31e19
commit 4d116e81c8

View File

@@ -373,17 +373,20 @@ def makeOrgUnitPathRelative(path):
def encodeOrgUnitPath(path): def encodeOrgUnitPath(path):
if path.find('+') == -1 and path.find('%') == -1: # 6.22 - This method no longer works.
# % no longer needs encoding and + is handled incorrectly in API with or without encoding
return path return path
encpath = '' # if path.find('+') == -1 and path.find('%') == -1:
for c in path: # return path
if c == '+': # encpath = ''
encpath += '%2B' # for c in path:
elif c == '%': # if c == '+':
encpath += '%25' # encpath += '%2B'
else: # elif c == '%':
encpath += c # encpath += '%25'
return encpath # else:
# encpath += c
# return encpath
def getOrgUnitItem(orgUnit, pathOnly=False, absolutePath=True): def getOrgUnitItem(orgUnit, pathOnly=False, absolutePath=True):