]> git.cworth.org Git - turbot/blob - turbot/hunt.py
Remove code (previously disabled) to invite users to new puzzle channel
[turbot] / turbot / hunt.py
1 def find_hunt_for_hunt_id(turb, hunt_id):
2     """Given a hunt ID find the database item for that hunt
3
4     Returns None if hunt ID is not found, otherwise a
5     dictionary with all fields from the hunt's row in the table,
6     (channel_id, active, hunt_id, name, url, sheet_url, etc.).
7     """
8
9     response = turb.table.get_item(
10         Key={
11             'hunt_id': hunt_id,
12             'SK': 'hunt-{}'.format(hunt_id)
13         })
14
15     if 'Item' in response:
16         return response['Item']
17     else:
18         return None