From 9561693890e7eef90f6d14ea73461cf783dbb535 Mon Sep 17 00:00:00 2001 From: Zhen Qian Date: Wed, 12 Jan 2022 16:35:13 -0500 Subject: [PATCH] issue-50 include assignment title string within double quotes (#51) * issue-50 replace : and / inside assignment title and course title strings * issue-50 no need to escape : and / characters. The simple fix is to include the group title within double quotes when doing group title search * issue-50 modification based on the review discusssion, that we will escape quotes inside the assignment title, and enclose the whole escaped title in the query string * issue-50 revert the unnecessary new line change for main.py file Co-authored-by: Qian --- arcgisUM.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arcgisUM.py b/arcgisUM.py index 98e511b..6c33b76 100644 --- a/arcgisUM.py +++ b/arcgisUM.py @@ -84,12 +84,8 @@ def getArcGISGroupByTitle(arcGISAdmin, title): :return: ArcGIS Group object or None :rtype: Group or None """ - searchString = "title:"+title - logger.debug("group search string: original: {}".format(searchString)) - - # quote characters that are special in the group search. - searchString = searchString.translate(str.maketrans({"?": r"\?","*": r"\*"})) - + escapedTitle = title.translate(str.maketrans({ '"': r'\"' })) + searchString = f'title:"{escapedTitle}"' logger.debug("group search string: escaped: {}".format(searchString)) try: