mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-10 22:53:34 +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:
14
src/gam.py
14
src/gam.py
@ -7064,11 +7064,15 @@ def doCreateGroup():
|
||||
i += 2
|
||||
elif myarg == u'description':
|
||||
description = sys.argv[i+1].replace(u'\\n', u'\n')
|
||||
if description.find(u'\n') != -1:
|
||||
gs_body[u'description'] = description
|
||||
if not gs:
|
||||
gs = buildGAPIObject(u'groupssettings')
|
||||
gs_object = gs._rootDesc
|
||||
# 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
|
||||
if not gs:
|
||||
gs = buildGAPIObject(u'groupssettings')
|
||||
gs_object = gs._rootDesc
|
||||
break
|
||||
else:
|
||||
body[u'description'] = description
|
||||
i += 2
|
||||
|
Reference in New Issue
Block a user