mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Updated gam create group to avoid a Google API issue that generated an error when the group description contains a <, > or =. (#518)
This commit is contained in:
@@ -7064,11 +7064,15 @@ def doCreateGroup():
|
|||||||
i += 2
|
i += 2
|
||||||
elif myarg == u'description':
|
elif myarg == u'description':
|
||||||
description = sys.argv[i+1].replace(u'\\n', u'\n')
|
description = sys.argv[i+1].replace(u'\\n', u'\n')
|
||||||
if description.find(u'\n') != -1:
|
# The Directory API Groups insert method can not handle any of these characters ('\n<>=') in the description field
|
||||||
|
# If any of these characters are present, use the Group Settings API to set the description
|
||||||
|
for c in u'\n<>=':
|
||||||
|
if description.find(c) != -1:
|
||||||
gs_body[u'description'] = description
|
gs_body[u'description'] = description
|
||||||
if not gs:
|
if not gs:
|
||||||
gs = buildGAPIObject(u'groupssettings')
|
gs = buildGAPIObject(u'groupssettings')
|
||||||
gs_object = gs._rootDesc
|
gs_object = gs._rootDesc
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
body[u'description'] = description
|
body[u'description'] = description
|
||||||
i += 2
|
i += 2
|
||||||
|
|||||||
Reference in New Issue
Block a user