else:
return None
-def quote_if_has_space(term):
- if ' ' in term:
- return '"{}"'.format(term)
- else:
- return term
-
def hunt_blocks(turb, hunt, puzzle_status='unsolved', search_terms=[]):
"""Generate Slack blocks for a hunt
for round in puzzle['rounds']:
rounds.add(round)
- hunt_text = "*{}* puzzles in hunt <{}|{}>".format(
+ hunt_text = "*{} puzzles in hunt <{}|{}>*".format(
puzzle_status.capitalize(),
channel_url(channel_id),
name
)
if search_terms:
- quoted_terms = [quote_if_has_space(term) for term in search_terms]
+ quoted_terms = ['`{}`'.format(term) for term in search_terms]
hunt_text += " matching {}".format(" AND ".join(quoted_terms))
blocks = [