# Add any new rounds to the database
if new_rounds:
for round in new_rounds.split(','):
+ # Drop any leading/trailing spaces from the round name
+ round = round.strip()
+ # Ignore any empty string
+ if not len(round):
+ continue
rounds.append(round)
turb.table.put_item(
Item={
# Set the status and solution fields in the database
puzzle['status'] = 'solved'
puzzle['solution'].append(args)
- del puzzle['state']
+ if 'state' in puzzle:
+ del puzzle['state']
turb.table.put_item(Item=puzzle)
# Report the solution to the puzzle's channel