We're planning to use a hyphen in the puzzles' channel names to
separate the hunt_id from the rest of the puzzle's channel name, so
the hunt_id itself must not contain any hyphen.
url = state['url']['url']['value']
# Validate that the hunt_id contains no invalid characters
- if not re.match(r'[-_a-zA-Z0-9]+$', hunt_id):
+ if not re.match(r'[_a-zA-Z0-9]+$', hunt_id):
print("Hunt ID field is invalid. Attmpting to return a clean error.")
return {
'statusCode': 200,
"response_action": "errors",
"errors": {
"hunt_id": "Hunt ID can only contain letters, "
- + "numbers, hyphens and underscores"
+ + "numbers, and underscores"
}
})
}