Permalink
Browse files

Use add_clue() and add_team() helpers

When using the Clue and Team constructors we skip some logic that these
helpers provide.  Use the helpers instead.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
  • Loading branch information...
1 parent 3352ad7 commit 5530a07ca5245cd463b98ed7dc018afec4f832a6 @stefanha stefanha committed Aug 7, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/controller.py
View
@@ -127,7 +127,7 @@ def post(self, hunt_id):
clue.delete()
for clue_dict in clues_list:
- Clue(hunt=hunt, question=clue_dict['question'], answer=clue_dict['answer']).put()
+ hunt.add_clue(clue_dict['question'], clue_dict['answer'])
self.redirect('/hunt/%s/clues' % hunt.key().id())
@@ -172,5 +172,5 @@ def post(self, hunt_id):
team.delete()
for team_dict in teams_list:
- Team(hunt=hunt, name=team_dict['name'], phone=team_dict['phone']).put()
+ hunt.add_team(team_dict['name'], team_dict['phone'])
self.redirect('/hunt/%s/teams' % hunt.key().id())

0 comments on commit 5530a07

Please sign in to comment.