Browse Source

added logging to run the repr() calls

master
Julio Biason 11 years ago
parent
commit
3f0a7b1dcd
  1. 4
      luncho/blueprints/voting.py

4
luncho/blueprints/voting.py

@ -150,10 +150,14 @@ def cast_vote(group_id):
# finally, cast the vote # finally, cast the vote
vote = Vote(request.user, group_id) vote = Vote(request.user, group_id)
LOG.debug('User {user} casted vote {vote}'.format(user=request.user,
vote=vote))
db.session.add(vote) db.session.add(vote)
db.session.commit() # so vote gets an id db.session.commit() # so vote gets an id
for (pos, place_id) in enumerate(request.as_json.get('choices')): for (pos, place_id) in enumerate(request.as_json.get('choices')):
place = CastedVote(vote, pos, place_id) place = CastedVote(vote, pos, place_id)
LOG.debug('\tVoted {place} in {pos} position'.format(place=place,
pos=pos))
db.session.add(place) db.session.add(place)
db.session.commit() db.session.commit()

Loading…
Cancel
Save