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"
}
})
}
sheet = turbot.sheets.sheets_create(turb, hunt_id)
# Insert the newly-created hunt into the database
- turb.hunts_table = turb.db.Table("hunts")
- turb.hunts_table.put_item(
+ hunts_table = turb.db.Table("hunts")
+ hunts_table.put_item(
Item={
'channel_id': channel_id,
"active": True,
"new_hunt": new_hunt
}
}
-
-submission_handlers = {
- "new_hunt": new_hunt_submission
-}