Skip to content

Commit

Permalink
issue-50 include assignment title string within double quotes (#51)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
zqian and Qian authored Jan 12, 2022
1 parent 6330823 commit 9561693
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arcgisUM.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9561693

Please sign in to comment.